grpc_recovery

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 4 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 grpc_recovery.

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary server interceptor for panic grpc_recovery.

Types

type Option

type Option func(*options)

func WithRecoveryHandler

func WithRecoveryHandler(f RecoveryHandlerFunc) Option

WithRecoveryHandler customizes the function for recovering from a panic.

func WithRecoveryHandlerContext

func WithRecoveryHandlerContext(f RecoveryHandlerFuncContext) Option

WithRecoveryHandlerContext customizes the function for recovering from a panic.

type RecoveryHandlerFunc

type RecoveryHandlerFunc func(p interface{}) (err error)

RecoveryHandlerFunc is a function that recovers from the panic `p` by returning an `error`.

type RecoveryHandlerFuncContext

type RecoveryHandlerFuncContext func(ctx context.Context, p interface{}) (err error)

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

Jump to

Keyboard shortcuts

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