contextutil

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInterrupted = errors.New("received interrupt")

	InterruptSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM, os.Interrupt}
)

Functions

func WithInterrupt

func WithInterrupt(ctx context.Context, signals ...os.Signal) (context.Context, context.CancelCauseFunc)

creates a context that can be cancelled by an interrupt signal

func WithInterruptCause

func WithInterruptCause(ctx context.Context, cause error, signals ...os.Signal) (context.Context, context.CancelCauseFunc)

creates a context that can be cancelled by an interrupt signal with a reason

Types

This section is empty.

Jump to

Keyboard shortcuts

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