Exemple #1
0
func main() {
	app := cli.NewApp()
	app.Name = "speedland-agent"
	app.Usage = "A agent command for speedland.net"
	app.Version = "1.0.0"
	app.Flags = []cli.Flag{
		cli.StringFlag{
			"config, c",
			"wcg.ini",
			"configuration file",
			"WCG_INI_FILE",
		},
	}
	app.Before = func(c *cli.Context) error {
		wcg.ConfigureProcess(c.String("config"))
		// normalize path
		lib.Config.Endpoint.Path = ""
		wcg.NewLogger(nil).Info("Used configurn file: %q", c.String("config"))
		wcg.NewLogger(nil).Info("Target Endpoint: %q", lib.Config.Endpoint)
		wcg.NewLogger(nil).Debug("Token: %q", lib.Config.Token)
		return nil
	}
	app.Commands = commands.AllCommands()
	app.Run(os.Args)
	wcg.WaitLogs()
}
Exemple #2
0
func init() {
	wcg.ViewTimezone, _ = time.LoadLocation("Asia/Tokyo")
	// search wcg.ini
	pwd, _ := os.Getwd()
	wcg.ConfigureProcess(getWcgIni(pwd))
	registerAhHandlers(GAEServer.Routes())
	registerCronHandlers(GAEServer.Routes())
	registerAuthHandlers(GAEServer.Routes())
	registerResponseHelperHandlers(GAEServer.Routes())
	registerJsonpProxyHandlers(GAEServer.Routes())
}
Exemple #3
0
func init() {
	wcg.RegisterProcessConfig(AppConfig, "rakugaki", nil)
	wcg.ConfigureProcess("wcg.ini")
	startServer()
}