Documentation ¶
Index ¶
- Variables
- func PanicLoggerStreamServerInterceptor(log *log.Entry) grpc.StreamServerInterceptor
- func PanicLoggerUnaryServerInterceptor(log *log.Entry) grpc.UnaryServerInterceptor
- func RatelimitStreamServerInterceptor(ratelimiter limiter.Store) grpc.StreamServerInterceptor
- func RatelimitUnaryServerInterceptor(ratelimiter limiter.Store) grpc.UnaryServerInterceptor
- func TranslateError(err error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorTranslationUnaryServerInterceptor = func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { resp, err = handler(ctx, req) return resp, TranslateError(err) } ErrorTranslationStreamServerInterceptor = func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { return TranslateError(handler(srv, ss)) } )
Functions ¶
func PanicLoggerStreamServerInterceptor ¶
func PanicLoggerStreamServerInterceptor(log *log.Entry) grpc.StreamServerInterceptor
PanicLoggerStreamServerInterceptor returns a new streaming server interceptor for recovering from panics and returning error
func PanicLoggerUnaryServerInterceptor ¶
func PanicLoggerUnaryServerInterceptor(log *log.Entry) grpc.UnaryServerInterceptor
PanicLoggerUnaryServerInterceptor returns a new unary server interceptor for recovering from panics and returning error
func RatelimitStreamServerInterceptor ¶ added in v3.4.0
func RatelimitStreamServerInterceptor(ratelimiter limiter.Store) grpc.StreamServerInterceptor
RatelimitStreamServerInterceptor returns a new stream server interceptor that performs rate limiting on the request.
func RatelimitUnaryServerInterceptor ¶ added in v3.4.0
func RatelimitUnaryServerInterceptor(ratelimiter limiter.Store) grpc.UnaryServerInterceptor
RatelimitUnaryServerInterceptor returns a new unary server interceptor that performs request rate limiting.
func TranslateError ¶
translate a K8S errors into gRPC error - assume that we want to surface this - which we may not
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.