feat 自定义拦截器
This commit is contained in:
@@ -20,11 +20,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) {
|
||||
grpc_pb.RegisterUserServer(serve, s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user