1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

feat:add grpc reflection register (#865)

This commit is contained in:
opensite 2021-04-26 22:48:39 +08:00 committed by GitHub
parent e1c84ece84
commit 4f1d2f056f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/health"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"
)
const loggerName = "transport/grpc"
@ -104,6 +105,8 @@ func NewServer(opts ...ServerOption) *Server {
srv.Server = grpc.NewServer(grpcOpts...)
// grpc health register
healthpb.RegisterHealthServer(srv.Server, srv.health)
// reflection register
reflection.Register(srv.Server)
return srv
}