Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
Types ¶
type Interceptor ¶
type Interceptor struct { // Notifier handles sending shutdown notifications. Notifier Notifier // contains filtered or unexported fields }
Interceptor contains channels and methods regarding application shutdown and interrupt signals.
func Intercept ¶
func Intercept() (Interceptor, error)
Intercept starts the interception of interrupt signals and returns an `Interceptor` instance. Note that any previous active interceptor must be stopped before a new one can be created.
func (*Interceptor) Alive ¶
func (c *Interceptor) Alive() bool
Alive returns true if the main interrupt handler has not been killed.
func (*Interceptor) Listening ¶
func (c *Interceptor) Listening() bool
Listening returns true if the main interrupt handler has been started, and has not been killed.
func (*Interceptor) RequestShutdown ¶
func (c *Interceptor) RequestShutdown()
RequestShutdown initiates a graceful shutdown from the application.
func (*Interceptor) ShutdownChannel ¶
func (c *Interceptor) ShutdownChannel() <-chan struct{}
ShutdownChannel returns the channel that will be closed once the main interrupt handler has exited.