Documentation ¶
Index ¶
- Variables
- func EnableDebug(s *grpc.Server)
- func EnableHealth(srv string, s *grpc.Server)
- func EnableReflection(s *grpc.Server)
- func NewAuthlessReflectionInterceptor(srv reflection.GRPCServer) reflection.GRPCServer
- func NoopUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func WithCustomCerts(certPath string, insecureSkipVerify bool) grpc.DialOption
- func WithSystemCerts(insecureSkipVerify bool) grpc.DialOption
- func WrapMethods(svcDesc grpc.ServiceDesc, interceptors ...grpc.UnaryServerInterceptor) (wrapped *grpc.ServiceDesc)
- func WrapStreams(svcDesc grpc.ServiceDesc, interceptors ...grpc.StreamServerInterceptor) (wrapped *grpc.ServiceDesc)
Constants ¶
This section is empty.
Variables ¶
var DefaultUnaryMiddleware = []grpc.UnaryServerInterceptor{grpcvalidate.UnaryServerInterceptor()}
DefaultUnaryMiddleware is a recommended set of middleware that should each gracefully no-op if the middleware is not applicable.
Functions ¶
func EnableDebug ¶
func EnableHealth ¶
func EnableReflection ¶
func NewAuthlessReflectionInterceptor ¶
func NewAuthlessReflectionInterceptor(srv reflection.GRPCServer) reflection.GRPCServer
NewAuthlessReflectionInterceptor creates a proxy GRPCServer which automatically converts ServerReflectionServer instances to onces that skip grpc auth middleware.
change: reflection.Register(srv) to: reflection.Register(grpcutil.NewAuthlessReflectionInterceptor(srv))
func NoopUnaryInterceptor ¶
func NoopUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
NoopUnaryInterceptor is a gRPC middleware that does not do anything.
func WithCustomCerts ¶
func WithCustomCerts(certPath string, insecureSkipVerify bool) grpc.DialOption
WithCustomCerts is a dial option for requiring TLS from a specified path. If the path is a directory, all certs are loaded. If it is an individual file only the directly specified cert is loaded.
This function panics if custom certificate pool cannot be instantiated.
func WithSystemCerts ¶
func WithSystemCerts(insecureSkipVerify bool) grpc.DialOption
WithSystemCerts is a dial option for requiring TLS with the system certificate pool.
This function panics if the system pool cannot be loaded.
func WrapMethods ¶
func WrapMethods(svcDesc grpc.ServiceDesc, interceptors ...grpc.UnaryServerInterceptor) (wrapped *grpc.ServiceDesc)
WrapMethods wraps all non-streaming endpoints with the given list of interceptors. It returns a copy of the ServiceDesc with the new wrapped methods.
func WrapStreams ¶
func WrapStreams(svcDesc grpc.ServiceDesc, interceptors ...grpc.StreamServerInterceptor) (wrapped *grpc.ServiceDesc)
WrapStreams wraps all streaming endpoints with the given list of interceptors. It returns a copy of the ServiceDesc with the new wrapped methods.
Types ¶
This section is empty.