func init() { fmt.Println("server Init.") runtime.GOMAXPROCS(8) memcachep.BindAction(memcachep.GET, GetAction) /* 获取配置文件信息 */ ini, err := goconfig.LoadConfigFile("./scanfile.conf") if err != nil { panic(err) } ConfigServerPath, err = ini.GetValue("server", "path") if err != nil { panic("config not found server.path") } ConfigServerPort, err = ini.Int("server", "port") if err != nil { panic("config not found server.port") } scanfile.MaxResult, err = ini.Int("server", "result_num") if err != nil { panic("config not found server.result_num") } }
//初始化绑定处理程序 func init() { memcachep.BindAction(memcachep.GET, GetAction) memcachep.BindAction(memcachep.SET, SetAction) }