Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exit ¶ added in v2.0.3
func Exit(code int)
Exit relays to os.Exit if no interrupt handlers are running, blocks otherwise.
func HandleInterrupts ¶ added in v2.0.3
func HandleInterrupts()
HandleInterrupts calls the handler functions on receiving a SIGINT or SIGTERM.
func RegisterInterruptHandler ¶ added in v2.0.3
func RegisterInterruptHandler(h InterruptHandler)
RegisterInterruptHandler registers a new InterruptHandler. Handlers registered after interrupt handing was initiated will not be executed.
Types ¶
type InterruptHandler ¶ added in v2.0.3
type InterruptHandler func()
InterruptHandler is a function that is called on receiving a SIGTERM or SIGINT signal.
Click to show internal directories.
Click to hide internal directories.