Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AbortedByUser = abortedErr{}
Functions ¶
func ClearHandlers ¶
func ClearHandlers()
ClearHandlers removes all Ctrl+C signal handlers. Use with care.
func HookCancelableContext ¶
func HookCancelableContext(ctx context.Context, cancelFn context.CancelFunc) (context.Context, context.CancelFunc)
HookCancelableContext returns a context that is canceled when the user presses Ctrl+C. The context is canceled with AbortedByUser.
func HookContext ¶
HookContext returns a context that is canceled when the user presses Ctrl+C. The context is canceled with AbortedByUser. If you're wrapping a context that already has a cancel function, use HookCancelableContext instead.
Types ¶
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.