grpc_recovery

package
v0.1.280 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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

type RecoveryHandlerStreamFunc func(fullMethodName string, p interface{}) (err error)

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)

RecoveryHandlerUnaryFuncContext 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL