feat grpc模块

This commit is contained in:
2026-01-19 10:53:16 +08:00
parent 86a07d63f1
commit 81bae2992d
3 changed files with 5 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
package grpc_server
import (
"git.hlsq.asia/mmorpg/service-common/config"
"git.hlsq.asia/mmorpg/service-common/discover/common"
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"git.hlsq.asia/mmorpg/service-common/proto/rs/grpc_pb"
@@ -12,12 +13,12 @@ type Server struct {
service.Base
}
func NewServer(ttl int64) *Server {
func NewServer(cfg *config.GrpcConfig) *Server {
s := &Server{
Base: service.Base{
Target: common.KeyDiscoverUser,
ServiceName: common.KeyDiscoverServiceNameUser,
EtcdTTL: ttl,
Cfg: cfg,
},
}
s.Base.OnCustomGrpcServerOption = s.OnCustomGrpcServerOption