43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
_ "git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/packed"
|
|
|
|
_ "git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/pub/xjpublogic"
|
|
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
|
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
|
|
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
|
|
|
_ "git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/logic"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/cmd"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/pub/pkg/initconsul"
|
|
"git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/pub/pkg/version"
|
|
"git.5iot.com/iotlcm-public/iotlcm-upstream-proxy/internal/pub/xjpubservice"
|
|
)
|
|
|
|
var (
|
|
BuildVersion = "0.0"
|
|
BuildTime = ""
|
|
CommitID = ""
|
|
)
|
|
|
|
func main() {
|
|
ctx := gctx.GetInitCtx()
|
|
// 初始化consul
|
|
err := initconsul.InitConsul(ctx)
|
|
if err != nil {
|
|
g.Log().Fatalf(ctx, "consul初始化失败: %+v", err)
|
|
os.Exit(1)
|
|
}
|
|
// 初始化系统
|
|
version.ShowLogo(ctx, BuildVersion, BuildTime, CommitID)
|
|
xjpubservice.Info().SetInfoBuild(BuildVersion, BuildTime, CommitID)
|
|
cmd.Main.Run(gctx.GetInitCtx())
|
|
}
|