recovery

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT 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 ZeroLogRecoveryHandler

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

ZeroLogRecoveryHandler todo

func NewZeroLogRecoveryHandler

func NewZeroLogRecoveryHandler() *ZeroLogRecoveryHandler

NewZeroLogRecoveryHandler todo

func (*ZeroLogRecoveryHandler) Handle

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

Handle todo

func (*ZeroLogRecoveryHandler) SetLogger

SetLogger todo

Jump to

Keyboard shortcuts

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