recovery

package
v2.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 6 Imported by: 223

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownRequest = errors.InternalServer("UNKNOWN", "unknown request error")

ErrUnknownRequest is unknown request error.

Functions

func Recovery

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

Recovery is a server middleware that recovers from any panics.

Types

type HandlerFunc

type HandlerFunc func(ctx context.Context, req, err any) error

HandlerFunc is recovery handler func.

type Latency added in v2.6.1

type Latency struct{}

Latency is recovery latency context key

type Option

type Option func(*options)

Option is recovery option.

func WithHandler

func WithHandler(h HandlerFunc) Option

WithHandler with recovery handler.

Jump to

Keyboard shortcuts

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