123456789101112131415161718192021222324252627282930313233343536373839 |
- package main
- import (
- "Ic_ouath/app"
- "Ic_ouath/global"
- "Ic_ouath/nats"
- _ "Ic_ouath/nats"
- "Ic_ouath/simple_zap"
- "context"
- )
- func init() {
- err := global.SetupSetting()
- if err != nil {
- simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "配置文件读取失败")
- }
- err = global.SetupDBLink()
- if err != nil {
- simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "数据库连接失败")
- }
- global.SetupRedisLink()
- nats.SetupNats()
- }
- func main() {
- err := app.InitRouter()
- if err != nil {
- simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "项目初始化失败")
- return
- }
- }
|