Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithSignal ¶
func WithSignal(ctx context.Context, fn func(ctx context.Context) error, signals ...os.Signal) error
WithSignal executes fn within a context that is canceled when one of specified signals is received from the OS. It's useful for wrapping some functions that should be canceled when the program receives e.g. SIGINT or SIGTERM.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.