Beispiel #1
0
func main() {
	//init
	initConfig()
	//register in gob
	framework.RigisterGob()

	go deviceManager.loopUpdate()
	go startWebSocket()
	//start connet to master
	diaMaster(getServerIP())
	log.Println("Slave Over!")
}
Beispiel #2
0
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())
}