Documentation ¶
Overview ¶
Package interceptors contains gRPC wrappers for logging and Prometheus metrics.
Index ¶
- func Stream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func StreamServiceEnabledInterceptor() grpc.StreamServerInterceptor
- func Unary(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func UnaryServiceEnabledInterceptor() grpc.UnaryServerInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stream ¶
func Stream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
Stream adds context logger and Prometheus metrics to stream server RPC.
func StreamServiceEnabledInterceptor ¶
func StreamServiceEnabledInterceptor() grpc.StreamServerInterceptor
StreamServiceEnabledInterceptor returns a new stream server interceptor that checks if service is enabled.
func Unary ¶
func Unary(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Unary adds context logger and Prometheus metrics to unary server RPC.
func UnaryServiceEnabledInterceptor ¶
func UnaryServiceEnabledInterceptor() grpc.UnaryServerInterceptor
UnaryServiceEnabledInterceptor returns a new unary server interceptor that checks if service is enabled.
Request on disabled service will be rejected with `FailedPrecondition` before reaching any userspace handlers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.