示例#1
0
func Start(c *gin.Context) {
	daemon.Start()
	c.JSON(200, gin.H{
		"task":   "start",
		"status": status.Get(),
	})
}
示例#2
0
//Boot handles flags and initializes configuration
func Boot() {
	configuration.Init(config)
	configuration.Debug = debug
	configuration.AutoStart = autoStart

	if testConfig {
		err := TestConfiguration()
		if err != nil {
			log.Panic(err)
		} else {
			os.Exit(0)
		}
	}

	if noActionHandling {
		configuration.C.NoActionHandling = true
	}

	if configuration.AutoStart {
		daemon.Start()
	}

	daemon.Spawn()
}