Documentation ¶
Overview ¶
Package sigint provides a Handler that calls exit handlers when the process has been interrupted by sigint (a ctrl-c typically).
Index ¶
Constants ¶
View Source
const (
// SigInt is the exit code that the shell returns if terminated with CTRL-C
SigInt = 130
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler waits on a sigint and exits the program after calling the set of callbacks.
var ( // DefaultHandler is the singleton for this package, because of the nature // of os.Exit() there's really no point to have multiple Handler's lying // around as only one can ever be executed. DefaultHandler *Handler )
func NewHandler ¶
func NewHandler() *Handler
NewHandler creates a new sigint handler. This starts a goroutine automatically to handle the signal.
Click to show internal directories.
Click to hide internal directories.