Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignalHandlerLoop ¶
func SignalHandlerLoop(log log.Logger, ss ...SignalReceiver)
SignalHandlerLoop blocks until it receives a SIGINT, SIGTERM or SIGQUIT. For SIGINT and SIGTERM, it exits; for SIGQUIT is print a goroutine stack dump.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles signals, can be interrupted. On SIGINT or SIGTERM it will exit, on SIGQUIT it will dump goroutine stacks to the Logger.
func NewHandler ¶
func NewHandler(log log.Logger, receivers ...SignalReceiver) *Handler
NewHandler makes a new Handler.
type SignalReceiver ¶
type SignalReceiver interface {
Stop() error
}
SignalReceiver represents a subsystem/server/... that can be stopped or queried about the status with a signal
Click to show internal directories.
Click to hide internal directories.