recovery

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: MIT Imports: 8 Imported by: 87

Documentation

Index

Constants

View Source
const RecoveryExplanation = "Something went wrong"

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

type Interceptor struct {
	// contains filtered or unexported fields
}

func Default

func Default() *Interceptor

func NewInterceptor

func NewInterceptor(h RecoveryHandler) *Interceptor

func (*Interceptor) StreamServerInterceptor

func (i *Interceptor) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*Interceptor) UnaryServerInterceptor

func (i *Interceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor

AuthUnaryServerInterceptor returns a new unary server interceptor for auth.

type RecoveryHandler

type RecoveryHandler interface {
	Handle(ctx context.Context, p interface{}) error
}

RecoveryHandler 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 ZapRecoveryHandler

type ZapRecoveryHandler struct {
	// contains filtered or unexported fields
}

ZapRecoveryHandler todo

func NewZapRecoveryHandler

func NewZapRecoveryHandler() *ZapRecoveryHandler

func (*ZapRecoveryHandler) Handle

func (h *ZapRecoveryHandler) Handle(ctx context.Context, p interface{}) error

func (*ZapRecoveryHandler) SetLogger

Jump to

Keyboard shortcuts

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