Пример #1
0
func init() {
	ServerConfig = lib.ReadConf("./config.json")
	logger = lib.GetLogger(ServerConfig.Get("logPath").(string))
	mongoAddr = ServerConfig.Get("mongo").(string)
	mongoDBName = ServerConfig.Get("database").(string)

	if mongoAddr == "" || mongoDBName == "" {
		panic("mongoAddr or mongoDBName is empty!")
	}

	flvcdUrlPrefix = ServerConfig.Get("flvcdUrlPrefix").(string)
	isRequestOnServer = ServerConfig.Get("isRequestDlUrlOnServer").(bool)

	//read video counter per minute
	go func() {
		readVideoCounter()
		ticker := time.NewTicker(time.Minute)
		for {
			select {
			case <-ticker.C:
				readVideoCounter()
			}
		}
	}()
}
Пример #2
0
func init() {
	config = module.ServerConfig
	logger = lib.GetLogger(config.Get("logPath").(string))
}