recovery

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPanicRecover = errors.InternalServer("PANIC_RECOVER", "Panic recover error")

ErrPanicRecover is panic recover error.

Functions

func Recovery

func Recovery(opts ...Option) middleware.Middleware

Recovery is a server middleware that recovers from any panics.

Types

type HandlerFunc added in v1.0.14

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

HandlerFunc is recovery handler func.

type Option added in v1.0.14

type Option func(*options)

Option is recovery option.

func WithDisablePrintStack added in v1.0.14

func WithDisablePrintStack(v bool) Option

WithDisablePrintStack DisablePrintStack disables printing stack trace.

func WithDisableStackAll added in v1.0.14

func WithDisableStackAll(v bool) Option

WithDisableStackAll disables formatting stack traces of all other goroutines

func WithDisabled added in v1.0.14

func WithDisabled(disabled bool) Option

WithDisabled set disabled recovery.

func WithHandler added in v1.0.14

func WithHandler(h HandlerFunc) Option

WithHandler with recovery handler.

func WithLogger added in v1.0.14

func WithLogger(log logger.Logger) Option

WithLogger with recovery logger.

func WithStackSize added in v1.0.14

func WithStackSize(size int) Option

WithStackSize with stack size.

Jump to

Keyboard shortcuts

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