Documentation
¶
Overview ¶
Package panics contains panic utility functions usable to handle panic recovery and stack trace generation.
Index ¶
- func Defer(op func(), logfn func(*bytes.Buffer))
- func DeferReport(op func(), logfn func(*bytes.Buffer))
- func GoDefer(title string, fx func())
- func GoDeferQuietly(title string, fx func())
- func Guard(fx func() error) error
- func GuardDefer(fx func(interface{}) error) func(interface{}) error
- func GuardWith(fx func(interface{}) error, d interface{}) error
- func LogRecoverHandler(tag string, opFunc func() error) error
- func RecoverHandler(tag string, opFunc func() error, recoFunc func(interface{})) error
- func ToString(value interface{}, indent bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Defer ¶
Defer provides a recovery handler functions for use to automate the recovery processes and logs out any panic that occurs.
func DeferReport ¶
DeferReport provides a recovery handler functions for use to automate the recovery processes and logs out any panic that occurs.
func GoDefer ¶
func GoDefer(title string, fx func())
GoDefer lets you run a function inside a goroutine that gets a defer recovery, and reports to stdout if a panic occurs.
func GoDeferQuietly ¶
func GoDeferQuietly(title string, fx func())
GoDeferQuietly lets you run a function inside a goroutine that gets a defer recovery but silently ignores the panic without logging to stdout.
func Guard ¶
Guard provides a function for handling panics safely, returning the error recieved after running a provided function.
func GuardDefer ¶
GuardDefer returns a function which guarded by a defer..recover() for handling panic recover.
func LogRecoverHandler ¶
LogRecoverHandler provides a recovery handler functions for use to automate the recovery processes and logs out any panic that occurs.
func RecoverHandler ¶
RecoverHandler provides a recovery handler functions for use to automate the recovery processes
Types ¶
This section is empty.