Documentation ¶
Index ¶
- func ChainUnaryServerInterceptors(is ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
- func LogUnaryServerInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
- func RequestValidationUnaryServerInterceptor() grpc.UnaryServerInterceptor
- type Option
- func WithAPIKeyAuthUnaryInterceptor(verifier rpcauth.APIKeyVerifier, logger *zap.Logger) Option
- func WithGRPCReflection() Option
- func WithGracePeriod(d time.Duration) Option
- func WithJWTAuthUnaryInterceptor(verifier jwt.Verifier, authorizer rpcauth.RBACAuthorizer, logger *zap.Logger) Option
- func WithLogUnaryInterceptor(logger *zap.Logger) Option
- func WithLogger(logger *zap.Logger) Option
- func WithPipedTokenAuthStreamInterceptor(verifier rpcauth.PipedTokenVerifier, logger *zap.Logger) Option
- func WithPipedTokenAuthUnaryInterceptor(verifier rpcauth.PipedTokenVerifier, logger *zap.Logger) Option
- func WithPort(port int) Option
- func WithPrometheusUnaryInterceptor() Option
- func WithRequestValidationUnaryInterceptor() Option
- func WithService(service Service) Option
- func WithTLS(certFile, keyFile string) Option
- type Server
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChainUnaryServerInterceptors ¶
func ChainUnaryServerInterceptors(is ...grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor
func LogUnaryServerInterceptor ¶
func LogUnaryServerInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor
LogUnaryServerInterceptor logs handled unary gRPC requests.
func RequestValidationUnaryServerInterceptor ¶
func RequestValidationUnaryServerInterceptor() grpc.UnaryServerInterceptor
RequestValidationUnaryServerInterceptor validates the request payload if the request implements requestValidator interface. An InvalidArgument with the detail message will be returned to client if the validation was not passed.
Types ¶
type Option ¶
type Option func(*Server)
Option defines a function to set configurable field of Server.
func WithAPIKeyAuthUnaryInterceptor ¶
func WithAPIKeyAuthUnaryInterceptor(verifier rpcauth.APIKeyVerifier, logger *zap.Logger) Option
WithAPIKeyAuthUnaryInterceptor sets an interceptor for validating API key.
func WithGRPCReflection ¶
func WithGRPCReflection() Option
WithGRPCReflection enables gRPC reflection service for debugging.
func WithGracePeriod ¶
WithGracePeriod sets maximum time to wait for gracefully shutdown.
func WithJWTAuthUnaryInterceptor ¶
func WithJWTAuthUnaryInterceptor(verifier jwt.Verifier, authorizer rpcauth.RBACAuthorizer, logger *zap.Logger) Option
WithJWTAuthUnaryInterceptor sets an interceprot for checking JWT token.
func WithLogUnaryInterceptor ¶
WithLogUnaryInterceptor sets an interceptor for logging handled request.
func WithPipedTokenAuthStreamInterceptor ¶
func WithPipedTokenAuthStreamInterceptor(verifier rpcauth.PipedTokenVerifier, logger *zap.Logger) Option
WithPipedTokenAuthStreamInterceptor sets an interceptor for validating piped key.
func WithPipedTokenAuthUnaryInterceptor ¶
func WithPipedTokenAuthUnaryInterceptor(verifier rpcauth.PipedTokenVerifier, logger *zap.Logger) Option
WithPipedTokenAuthUnaryInterceptor sets an interceptor for validating piped key.
func WithPrometheusUnaryInterceptor ¶
func WithPrometheusUnaryInterceptor() Option
WithPrometheusUnaryInterceptor sets an interceptor for Prometheus monitoring.
func WithRequestValidationUnaryInterceptor ¶
func WithRequestValidationUnaryInterceptor() Option
WithRequestValidationUnaryInterceptor sets an interceptor for validating request payload.
func WithService ¶
WithService appends gRPC service to server.