Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSignal = errors.New("received signal")
ErrSignal is wrapped by the errors returned by WaitFunc when a signal has been received.
Functions ¶
This section is empty.
Types ¶
type WaitFunc ¶
WaitFunc is the type of functions waiting for signals.
func Setup ¶
func Setup(signals ...os.Signal) (wait WaitFunc, stop context.CancelFunc)
Setup starts relaying incoming signals into an internal buffer. The returned wait function sleeps until either a signal has been received (which may have happened before the wait function is called) or the wait function's context is canceled. The stop function causes signals to not be captured anymore.
Click to show internal directories.
Click to hide internal directories.