main.go
954 字节
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
package main
import (
"fmt"
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/config"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/redis"
"openapi/pkg/constant"
_ "openapi/pkg/infrastructure/bgorm"
_ "openapi/pkg/log"
_ "openapi/pkg/port/beego"
)
func main() {
defer func() {
log.Info("server on stop!")
}()
log.Info("server on start!")
//constant.DebugConfig()
//https
//beego.BConfig.Listen.EnableHTTPS = true
//beego.BConfig.Listen.Graceful = true
//beego.BConfig.Listen.HTTPSPort = 443
//beego.BConfig.Listen.HTTPSCertFile = "conf/_.fjmaimaimai.com_bundle.crt"
//beego.BConfig.Listen.HTTPSKeyFile = "conf/fjmaimaimai.com_RSA.fjmaimaimai.com_RSA.key"
err := redis.Init(config.Redis{
Addr: fmt.Sprintf("%v:%v", constant.REDIS_HOST, constant.REDIS_PORT),
Password: constant.REDIS_AUTH,
MaxIdle: 50,
})
if err != nil {
log.Error(err)
}
beego.Run()
}