context

package
v0.0.0-...-0a82276 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSourceableError

func WithSourceableError(ctx context.Context, source SourceableError) context.Context

WithSourceableError returns a new Context that carries the source. When the Err method is checked on the context, it will return the error from the source if the context was canceled or deadline exceeded.

Types

type ContextKey

type ContextKey string

ContextKey defines a type for selecting values within a given context.

type SourceableError

type SourceableError interface {
	Err() error
}

SourceableError is an interface that can be implemented by errors that can be used as the source of a context error.

Jump to

Keyboard shortcuts

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