recovery

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RecoveryExplanation = "Something went wrong"

RecoveryExplanation 异常消息

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler 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 Interceptor

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

Interceptor todo

func Default

func Default() *Interceptor

Default todo

func NewInterceptor

func NewInterceptor(h Handler) *Interceptor

NewInterceptor todo

func (*Interceptor) StreamServerInterceptor

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

StreamServerInterceptor todo

func (*Interceptor) UnaryServerInterceptor

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

UnaryServerInterceptor returns a new unary server interceptor for auth.

type ZapRecoveryHandler

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

ZapRecoveryHandler todo

func NewZapRecoveryHandler

func NewZapRecoveryHandler() *ZapRecoveryHandler

NewZapRecoveryHandler todo

func (*ZapRecoveryHandler) Handle

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

Handle todo

func (*ZapRecoveryHandler) SetLogger

SetLogger todo

Jump to

Keyboard shortcuts

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