recovery

package
v0.0.0-...-680e691 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recover

func Recover(opts ...Option)

Recover 用于保护go routine,默认打印日志 example:

go func() {
		defer recovery.Recover()
}

func SetDefault

func SetDefault(f RecoverFunc)

SetDefault 设置默认recover函数

Types

type Option

type Option func(o *Options)

func WithCtx

func WithCtx(ctx context.Context) Option

func WithError

func WithError(err *error) Option

type Options

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

type RecoverFunc

type RecoverFunc func(ctx context.Context, err error)

Jump to

Keyboard shortcuts

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