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

This commit is contained in:
2026-02-07 13:15:27 +08:00
parent ec4c3c0413
commit fc9b32b115
4 changed files with 11 additions and 9 deletions

View File

@@ -17,17 +17,15 @@ 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, &ModuleWebServer{})
p.moduleList = append(p.moduleList, &ModuleWebsocketServer{})
p.moduleList = append(p.moduleList, &ModuleLoginQueue{})
p.moduleList = append(p.moduleList, &module.Grpc{Server: grpc_server.NewServer(config.Get().Serve.Grpc)})
p.moduleList = append(p.moduleList, &module.Prometheus{MetricCfg: config.Get().Metric})
p.moduleList = append(p.moduleList, &module.Tracer{MetricCfg: config.Get().Metric, ServiceName: common.KeyDiscoverServiceNameGateway})
p.moduleList = append(p.moduleList, &module.Prometheus{Cfg: config.Get().Metric})
p.moduleList = append(p.moduleList, &module.Tracer{Cfg: config.Get().Metric, ServiceName: common.KeyDiscoverServiceNameGateway})
p.moduleList = append(p.moduleList, &module.Discover{})
for _, m := range p.moduleList {