Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor for panic recovery.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor for panic recovery.
Types ¶
type Option ¶
type Option func(*options)
func WithRecoveryHandlerStream ¶
func WithRecoveryHandlerStream(f RecoveryHandlerStreamFunc) Option
WithRecoveryHandlerStream customizes the function for recovering from a panic.
func WithRecoveryHandlerUnary ¶
func WithRecoveryHandlerUnary(f RecoveryHandlerUnaryFunc) Option
WithRecoveryHandlerUnary customizes the function for recovering from a panic.
func WithRecoveryHandlerUnaryContext ¶
func WithRecoveryHandlerUnaryContext(f RecoveryHandlerUnaryFuncContext) Option
WithRecoveryHandlerUnaryContext customizes the function for recovering from a panic.
func WithRecoveryHandlerUnaryStreamContext ¶
func WithRecoveryHandlerUnaryStreamContext(f RecoveryHandlerStreamFuncContext) Option
WithRecoveryHandlerUnaryStreamContext customizes the function for recovering from a panic.
type RecoveryHandlerStreamFunc ¶
RecoveryHandlerStreamFunc is a function that recovers from the panic `p` by returning an `error`.
type RecoveryHandlerStreamFuncContext ¶
type RecoveryHandlerStreamFuncContext func(ctx context.Context, fullMethodName string, p interface{}) (err error)
RecoveryHandlerStreamFuncContext is a function that recovers from the panic `p` by returning an `error`. The context can be used to extract request scoped metadata and context values.
type RecoveryHandlerUnaryFunc ¶
type RecoveryHandlerUnaryFunc func(fullMethodName string, p interface{}) (resp interface{}, err error)
RecoveryHandlerUnaryFunc is a function that recovers from the panic `p` by returning an abritrary object which could be an `error`.
type RecoveryHandlerUnaryFuncContext ¶
type RecoveryHandlerUnaryFuncContext func(ctx context.Context, fullMethodName string, p interface{}) (resp interface{}, err error)
RecoveryHandlerFuncContext is a function that recovers from the panic `p` by returning an abritrary object which could be an `error`. The context can be used to extract request scoped metadata and context values.