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