Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Awaiting ¶
type Awaiting = sigHandler
Awaiting is a signal handler that is active while waiting for a specific function to finish
func NewAwaitingSigHandler ¶
NewAwaitingSigHandler constructs a signal handler awaiting a function to return
func (*Awaiting) WaitForFunc ¶
WaitForFunc waits for `f` to return, unless a signal on the sigCh is received. In that case, we return a SignalError.
type Background ¶
type Background struct {
// contains filtered or unexported fields
}
Background listens for signals in the background
func NewBackgroundSignalHandler ¶
func NewBackgroundSignalHandler(callback func(os.Signal), signals ...os.Signal) *Background
NewBackgroundSignalHandler constructs a signal handler that processes signals in the background until stopped or closed
type SignalError ¶
type SignalError struct {
// contains filtered or unexported fields
}
SignalError is returned by the AwaitingSigHandler if an interrupt signal was received
func (SignalError) Error ¶
func (se SignalError) Error() string
Error returns an message about the received event
func (SignalError) Signal ¶
func (se SignalError) Signal() os.Signal
Signal returns the received signal
Click to show internal directories.
Click to hide internal directories.