Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
func Exit(code int)
Exit will ultimately call os.Exit once any registered shutdown hooks run
func IsInsideContainer ¶
func IsInsideContainer() bool
IsInsideContainer returns true if the process is running inside a containerized environment like docker or kubernetes
func OnExit ¶
func OnExit(handler OnExitFunc)
OnExit will register an OnExitFunc to be called in reverse order (LIFO) when the process exits. this handler will only get called if the program exits through Exit - however, a SIGINT or SIGTERM event should also signal OnExit handlers
Types ¶
type OnExitFunc ¶
type OnExitFunc func(code int)
OnExitFunc is a handler for registering for exit events
Click to show internal directories.
Click to hide internal directories.