contexts

package
v1.154.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsContextCanceledErr

func IsContextCanceledErr(err error) bool

IsContextCanceledErr checks whether the given error is caused by context cancellation.

func SetupSignalHandler

func SetupSignalHandler() context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL