代码拉取完成,页面将自动刷新
package leaf
import (
"github.com/name5566/leaf/cluster"
"github.com/name5566/leaf/conf"
"github.com/name5566/leaf/console"
"github.com/name5566/leaf/log"
"github.com/name5566/leaf/log/zap"
"github.com/name5566/leaf/module"
"os"
"os/signal"
"syscall"
)
func Run(mods ...module.Module) {
// logger
config := &log.Config{
Debug: conf.LogDebug,
Level: conf.LogLevel,
Net: "udp",
Addr: conf.LogAddr,
Tag: conf.LogTag,
Filename: conf.LogPath,
MaxSize: conf.LogMaxSize,
MaxAge: conf.LogMaxAge,
MaxBackups: conf.LogMaxBackups,
LocalTime: conf.LogLocalTime,
Compress: conf.LogCompress,
}
log.SetLogger(zap.NewLogger(config.BuildOption()...))
log.Infof("meta fish %v starting up", version)
// module
for i := 0; i < len(mods); i++ {
module.Register(mods[i])
}
module.Init()
// cluster
cluster.Init()
// console
console.Init()
// close
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)
sig := <-c
log.Infof("dhf closing down (signal: %v)", sig)
console.Destroy()
cluster.Destroy()
module.Destroy()
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。