Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SignalHandler ¶
type SignalHandler struct {
// contains filtered or unexported fields
}
SignalHandler is a basic, abstract signal handler that is implementable in most go applications without much effort
func ConstructSignalHandler ¶
func ConstructSignalHandler() *SignalHandler
ConstructSignalHandler will create a new SignalHandler
func (*SignalHandler) Listen ¶
func (handler *SignalHandler) Listen()
Listen will wait for signals to come in, go through registered signal functions and execute them
func (*SignalHandler) RegisterSignalFunction ¶
func (handler *SignalHandler) RegisterSignalFunction(sig os.Signal, callback func() error)
RegisterSignalFunction allows you to specify a function to be called when a signal is received by the signal handler
func (*SignalHandler) SetOutput ¶
func (handler *SignalHandler) SetOutput(outputFunction func(v ...interface{}))
SetOutput will set the output function used to print errors should they occurr
func (*SignalHandler) Start ¶
func (handler *SignalHandler) Start()
Start will listen, async, in a seperate go-routine.
Click to show internal directories.
Click to hide internal directories.