package main import ( "fmt" "git.hilo.cn/hilo-common/resource/consul" "git.hilo.cn/hilo-common/resource/redisCli" "hilo-group/cron" "hilo-group/domain/service/event_s" "hilo-group/route" ) const ( PORT = 9050 RegisterName = "hiloGroup" RegisterTag = "群组中心" ) func main() { cron.Init() // 开启定时任务 event_s.EventInit() // 注册事件(内部事件+mysql拟kafka) redisCli.InitCluster() // redis集群 r := route.InitRouter() // 注册路由 consul.RegisterToConsul(PORT, RegisterName, RegisterTag) // 服务注册 r.Run(fmt.Sprintf(":%d", PORT)) // 启动服务 }