Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Chan is used to receive SIGINT (Ctrl+C) signals. Chan chan os.Signal // Signals is the list of signals that cause the interrupt Signals = []os.Signal{os.Interrupt, syscall.SIGTERM} // ShutdownRequestChan is a channel that can receive shutdown requests ShutdownRequestChan = make(chan struct{}) // AddHandlerChan is used to add an interrupt handler to the list of // handlers to be invoked on SIGINT (Ctrl+C) signals. AddHandlerChan = make(chan func()) // HandlersDone is closed after all interrupt handlers run the first time // an interrupt is signaled. HandlersDone = make(chan struct{}) )
Functions ¶
func AddHandler ¶
func AddHandler(handler func())
AddHandler adds a handler to call when a SIGINT (Ctrl+C) is received.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.