Package osutil implements operating system-related utility functions.
func Exit(code int)
Exit relays to os.Exit if no interrupt handlers are running, blocks otherwise.
func HandleInterrupts ¶
HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.
func RegisterInterruptHandler(h InterruptHandler)
RegisterInterruptHandler registers a new InterruptHandler. Handlers registered after interrupt handing was initiated will not be executed.