contextutils

package
v0.0.0-...-25ef478 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMergedContextCanceled = errors.New("merged context canceled")
)

Functions

func MergeContexts

func MergeContexts(ctxPrimary context.Context, ctxSecondary context.Context) (context.Context, context.CancelFunc)

MergeContexts creates a new mergedContext based on two contexts.

func ReturnErrIfChannelClosed

func ReturnErrIfChannelClosed(channel <-chan struct{}, err error) error

ReturnErrIfChannelClosed returns the given error if the provided channel was closed.

func ReturnErrIfCtxDone

func ReturnErrIfCtxDone(ctx context.Context, err error) error

ReturnErrIfCtxDone returns the given error if the provided context is done.

Types

This section is empty.

Jump to

Keyboard shortcuts

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