Documentation
¶
Overview ¶
Package shutdown can be used to execute stuff, when the app is going to exit (exit code x or SigTerm)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
func Exit(exitCode int)
Exit Use this function to do a clean exit. Only here the functions will be executed. Not on os.Exit
func ExitOnPanic ¶
func ExitOnPanic()
ExitOnPanic This function can be called, when panic is caught. Call then this to exit gracefully.
Types ¶
type Observer ¶
type Observer interface {
AddCommand(fn ObserverFunc)
}
Observer Interface of the singleton. Adds a function.
func GetObserver ¶
func GetObserver() Observer
GetObserver Gets the singleton instance. Creates one on first call.
type ObserverFunc ¶
type ObserverFunc func() error
ObserverFunc Function signature for the function to execute
Click to show internal directories.
Click to hide internal directories.