1 Star 1 Fork 0

go-wena/app

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.go 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
k3x 提交于 2021-06-12 02:41 . 调整sql和redis顺序
package app
import (
"context"
"os"
"os/signal"
"syscall"
"time"
"gitee.com/go-wena/app/internal/hs"
"gitee.com/go-wena/app/internal/redis"
"gitee.com/go-wena/app/internal/sql"
"gitee.com/go-wena/env"
)
func Execute(appName, appVersion, appDescription string, appBuildTime time.Time, runs ...func()) {
name = appName
description = appDescription
version = appVersion
buildTime = appBuildTime
headerPrint()
env.Auto()
for _, run := range runs {
run()
}
var ctx, cancel = signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, os.Kill, syscall.SIGUSR1, syscall.SIGUSR2)
defer cancel()
sql.Auto()
redis.Auto()
if env.GetBool("router.enabled", true) {
hs.Start(ctx, router.Handler())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/go-wena/app.git
git@gitee.com:go-wena/app.git
go-wena
app
app
v0.0.11

搜索帮助