feat 基础模块拆分为雪花和日志模块

This commit is contained in:
2026-02-07 13:15:29 +08:00
parent c2807b54df
commit 1a42e055ae
4 changed files with 11 additions and 9 deletions

View File

@@ -16,15 +16,13 @@ type Program struct {
}
func (p *Program) Init(_ svc.Environment) error {
if err := config.LoadConfig(); err != nil {
return err
}
p.moduleList = append(p.moduleList, &module.Base{Log: config.Get().Log})
p.moduleList = append(p.moduleList, &module.Log{Cfg: config.Get().Log})
p.moduleList = append(p.moduleList, &module.DB{Cfg: config.Get().DB, AppName: config.Get().App.Name})
p.moduleList = append(p.moduleList, &module.Snowflake{})
p.moduleList = append(p.moduleList, &module.Grpc{Server: grpc_server.NewServer(config.Get().Serve.Grpc)})
p.moduleList = append(p.moduleList, &ModuleTimer{})
p.moduleList = append(p.moduleList, &module.Prometheus{MetricCfg: config.Get().Metric})
p.moduleList = append(p.moduleList, &module.Tracer{MetricCfg: config.Get().Metric, ServiceName: common.KeyDiscoverServiceNameQgdzs})
p.moduleList = append(p.moduleList, &module.Prometheus{Cfg: config.Get().Metric})
p.moduleList = append(p.moduleList, &module.Tracer{Cfg: config.Get().Metric, ServiceName: common.KeyDiscoverServiceNameQgdzs})
p.moduleList = append(p.moduleList, &module.Discover{})
for _, m := range p.moduleList {