示例#1
0
文件: main.go 项目: icsnju/apt-core
func main() {
	//init
	initConfig()
	//register in gob
	framework.RigisterGob()

	go deviceManager.loopUpdate()
	go startWebSocket()
	//start connet to master
	diaMaster(getServerIP())
	log.Println("Slave Over!")
}
示例#2
0
文件: main.go 项目: icsnju/apt-core
func main() {
	//register in gob
	framework.RigisterGob()
	filter.RigisterGob()

	//init config
	config.InitConfig()
	//init DB
	err := models.InitDB(config.GetDBUrl(), config.GetDBName())
	if err != nil {
		log.Fatalln(err)
	}
	defer models.CloseDB()

	go startServer()
	master.StartMaster(config.GetPort())
}