-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (37 loc) · 1 KB
/
Copy pathmain.go
File metadata and controls
46 lines (37 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"fmt"
"github.com/astaxie/beego"
"github.com/lunny/log"
"runtime"
"wechatdll/TcpPoll"
"wechatdll/comm"
_ "wechatdll/routers"
)
func main() {
longLinkEnabled, _ := beego.AppConfig.Bool("longlinkenabled")
comm.RedisInitialize()
_, err := comm.RedisClient.Ping().Result()
if err != nil {
panic(fmt.Sprintf("【Redis】连接失败,ERROR:%v", err.Error()))
}
comm.RabbitMQSetup()
sysType := runtime.GOOS
if sysType == "linux" && longLinkEnabled {
// LINUX系统
tcpManager, err := TcpPoll.GetTcpManager()
if err != nil {
log.Errorf("TCP启动失败.")
}
go tcpManager.RunEventLoop()
}
// bee generate docs 生成文档
// 初始化自动心跳包
//go wxcore.GetWXConnectMgr().InitAutoHeartBeat()
beego.BConfig.WebConfig.DirectoryIndex = true
beego.BConfig.WebConfig.StaticDir["/"] = "swagger"
beego.SetLogFuncCall(false)
//beego.InsertFilter("/*", beego.BeforeRouter, middleware.BaseAuthLog, false)
beego.Run()
// 生成 swagger 文档 bee generate docs
}