Documentation ¶
Overview ¶
base recovery, RecoveryHandlerFunc spit UnaryRecoveryHandlerFunc and StreamRecoveryHandlerFunc
Index ¶
- func NewRecoveryServer(unaryCustomFunc UnaryRecoveryHandlerFunc, ...) *grpc.Server
- func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
- type Option
- type StreamRecoveryHandlerFunc
- type UnaryRecoveryHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRecoveryServer ¶
func NewRecoveryServer(unaryCustomFunc UnaryRecoveryHandlerFunc, streamCustomFunc StreamRecoveryHandlerFunc) *grpc.Server
Initialization shows an initialization sequence with a custom recovery handler func.
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 WithStreamRecoveryHandler ¶
func WithStreamRecoveryHandler(f StreamRecoveryHandlerFunc) Option
WithStreamRecoveryHandler customizes the function for recovering from a panic.
func WithUnaryRecoveryHandler ¶
func WithUnaryRecoveryHandler(f UnaryRecoveryHandlerFunc) Option
WithUnaryRecoveryHandler customizes the function for recovering from a panic.
type StreamRecoveryHandlerFunc ¶
type StreamRecoveryHandlerFunc func(stream grpc.ServerStream, p interface{}) (err error)
type UnaryRecoveryHandlerFunc ¶
RecoveryHandlerFunc is a function that recovers from the panic `p` by returning an `error`.
Click to show internal directories.
Click to hide internal directories.