refactor: centralize protobuf and remove go-zero

This commit is contained in:
2026-08-09 15:10:19 +08:00
parent 5cc5fd92ed
commit 4bbed3156c
357 changed files with 14208 additions and 19903 deletions

View File

@@ -1,29 +1,21 @@
package impl
import (
"fmt"
"bsm/full/module/ec/delivery/internal/config"
"git.apinb.com/bsm-sdk/engine/service"
)
var (
Configure config.Config
)
func NewService(srvKey string) {
// register service
service.Register(srvKey, &Configure)
service.RegisterAnonymous(&Configure.RpcServerConf, &Configure.Anonymous)
service.Start(Configure.ListenOn)
// with activating
withModel() // model
withMemCache() // mem cache
withRedisCache() // redis cache
withPulsar() // mq - pulsar
// service done.
service.Done(&Configure.Prometheus, &Configure.Telemetry)
var Configure config.Config
func NewService(serviceKey string) error {
cfg, err := config.Load(serviceKey)
if err != nil {
return err
}
Configure = cfg
if err := withModel(); err != nil {
return fmt.Errorf("initialize model: %w", err)
}
return nil
}