feat 自定义拦截器

This commit is contained in:
2026-01-16 23:51:45 +08:00
parent b76595d164
commit ba16c2cce3
5 changed files with 20 additions and 4 deletions

View File

@@ -21,11 +21,16 @@ func NewServer(ttl int64) *Server {
EtcdTTL: ttl,
},
}
s.Base.OnCustomGrpcServerOption = s.OnCustomGrpcServerOption
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnCustomGrpcServerOption() []grpc.ServerOption {
return nil
}
func (s *Server) OnInit(serve *grpc.Server) {
client.GatewaySID = s.SID
grpc_pb.RegisterGatewayServer(serve, s)