feat 自定义拦截器

This commit is contained in:
2026-01-16 23:51:48 +08:00
parent 450f89107a
commit 9d7397b279
3 changed files with 8 additions and 3 deletions

View File

@@ -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)
}