Esempio n. 1
0
func setConfig() {
	var err error
	cfg, err := goconfig.LoadConfigFile("./cfg/config.ini")
	if err != nil {
		ImServerLog("open config.ini err", err)
	}
	//MaxSession
	MaxSession, err = cfg.Int("IMServer", "MAX_SESSIONS")
	if err != nil {
		ImServerLog("Get Maxsessions from config.ini err", err)
	}
	//MaxMemberInGroup
	MaxMemberInGroup, err = cfg.Int("IMServer", "MaxMemberInGroup")
	if err != nil {
		ImServerLog("Get MaxMemberInGroup from config.ini err", err)
	}
	//TokenTime
	TokenTime, err = cfg.Int("IMServer", "TokenTime")
	if err != nil {
		ImServerLog("Get TokenTime from config.ini err", err)
	}
	//MaxRecendTimes
	MaxRecendTimes, err = cfg.Int("IMServer", "MaxRecendTimes")
	if err != nil {
		ImServerLog("Get MaxRecendTimes from config.ini err", err)
	}
	//PacketBufSize
	PacketBufSize, err = cfg.Int("IMServer", "PacketBufSize")
	if err != nil {
		ImServerLog("Get PacketBufSize from config.ini err", err)
	}
}
Esempio n. 2
0
func getMonitorPath() (mpath string, err error) {
	cfg, err := goconfig.LoadConfigFile("./etc/live_box.conf")
	if err != nil {
		logger.Fatal("load config file live_box.conf failed!")
		return "", err
	}
	return cfg.GetValue("taskGenerator", "video_path")
}