Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsContextCanceledErr ¶
IsContextCanceledErr checks whether the given error is caused by context cancellation.
func SetupSignalHandler ¶
SetupSignalHandler registers for SIGTERM and SIGINT. A context is returned which is canceled on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
This code is a variant of the code from controller-runtime/pkg/signals, modified to use context.WithCancelCause so that the reason for cancellation can be propagated. This allows callers to distinguish between normal cancellation and cancellation due to termination signals.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.