예제 #1
0
func main() {
	tracelog.Start(tracelog.LevelTrace)

	// Init mongo
	tracelog.Started("main", "Initializing Mongo")
	err := mongo.Startup(helper.MainGoRoutine)
	if err != nil {
		tracelog.CompletedError(err, helper.MainGoRoutine, "initApp")
		os.Exit(1)
	}

	// Load message strings
	localize.Init("en-US")

	SessionConfig, err := session.GetSessionConfig("session")

	tracelog.Trace("main", "SessionConfig", "Session : On[%v]", SessionConfig.On)
	tracelog.Trace("main", "SessionConfig", "Session : On[%v]", SessionConfig.Provider)
	tracelog.Trace("main", "SessionConfig", "Session : On[%v]", SessionConfig.SavePath)

	beego.SessionOn = SessionConfig.On
	beego.SessionProvider = SessionConfig.Provider
	beego.SessionSavePath = SessionConfig.SavePath

	beego.Run()

	tracelog.Completed(helper.MainGoRoutine, "Website Shutdown")
	tracelog.Stop()
}
예제 #2
0
// init initializes all required packages and systems
func init() {
	//	log.Start(log.LEVEL_TRACE)

	// Init mongo
	log.Started("main", "Initializing Mongo")
	err := mongo.Startup(helper.MainGoRoutine)
	if err != nil {
		log.CompletedError(err, helper.MainGoRoutine, "initTesting")
		return
	}

	// Load message strings
	localize.Init("en-US")
}
예제 #3
0
func main() {
	tracelog.Start(tracelog.LevelTrace)

	// Init mongo
	tracelog.Started("main", "Initializing Mongo")
	err := mongo.Startup(helper.MainGoRoutine)
	if err != nil {
		tracelog.CompletedError(err, helper.MainGoRoutine, "initApp")
		os.Exit(1)
	}

	// Load message strings
	localize.Init("en-US")
	beego.BConfig.WebConfig.Session.SessionOn = true
	globalSessions, _ = session.NewManager("redis", `{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:6379"}`)
	go globalSessions.GC()
	beego.Run()

	tracelog.Completed(helper.MainGoRoutine, "Website Shutdown")
	tracelog.Stop()
}