1 Star 1 Fork 28

Louis/go-iot

forked from 有理想的鸭子/go-iot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 843 Bytes
一键复制 编辑 原始数据 按行查看 历史
有理想的鸭子 提交于 2023-11-18 16:17 +08:00 . 增加构建信息
package main
import (
"fmt"
_ "go-iot/pkg/api"
"go-iot/pkg/api/web"
"go-iot/pkg/cluster"
"go-iot/pkg/core"
"go-iot/pkg/core/store"
_ "go-iot/pkg/core/timeseries"
"go-iot/pkg/es"
"go-iot/pkg/logger"
"go-iot/pkg/models"
"go-iot/pkg/option"
"go-iot/pkg/redis"
_ "go-iot/pkg/registry"
"os"
)
func main() {
opt := option.New()
msg, err := opt.Parse()
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", msg)
os.Exit(1)
}
// log config
logger.Init(opt)
defer logger.Sync()
logger.Infof("RELEASE: %s", option.RELEASE)
logger.Infof("BUILD_TIME: %s", option.BUILD_TIME)
logger.Infof("COMMIT: %s", option.COMMIT)
logger.Infof("REPO: %s", option.REPO)
// configs
core.RegDeviceStore(store.NewRedisStore())
cluster.Config(opt)
es.Config(opt)
redis.Config(opt)
// init db
models.InitDb()
web.MustNewServer(opt.APIAddr)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/Louiscoding/go-iot.git
git@gitee.com:Louiscoding/go-iot.git
Louiscoding
go-iot
go-iot
master

搜索帮助