safego

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

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

func Run

func Run(f func()) *Execution

Run runs a new goroutine and add panic handler (without restart)

func RunWithRestart

func RunWithRestart(f func()) *Execution

RunWithRestart run a new goroutine and add panic handler: write logs, wait 2 seconds and restart the goroutine

func (*Execution) WithRestartTimeout

func (exec *Execution) WithRestartTimeout(timeout time.Duration) *Execution

type RecoverHandler

type RecoverHandler func(value interface{})
var GlobalRecoverHandler RecoverHandler

Jump to

Keyboard shortcuts

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