Documentation ¶
Overview ¶
Package sigintTrap allows us to control when the user can press control+C
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TrapMessage = colors.Yellow + "Ctrl+C. Finishing..." + colors.Off
Functions ¶
func Enable ¶
func Enable(ctx context.Context, cancel context.CancelFunc, cleanUp CleanupFunction) chan os.Signal
Enable enables the trap, by blocking control-C. It returns a channel that will get a value when user presses ctrl-C.
Types ¶
type CleanupFunction ¶
type CleanupFunction func()
Click to show internal directories.
Click to hide internal directories.