Documentation ¶
Index ¶
- Variables
- func AfterFunc(ctx Context, f func()) (stop func() bool)
- func LocalValue[T any](ctx Context, key []byte) (v T, has bool)
- func Release(ctx context.Context)
- func UserValue[T any](ctx Context, key []byte) (v T, has bool, err error)
- func Value[T any](ctx Context, key any) (v T, has bool)
- func WithCancel(parent Context) (Context, CancelFunc)
- func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc)
- func WithDeadlineCause(parent Context, deadline time.Time, cause error) (Context, CancelFunc)
- func WithTimeout(parent Context, ttl time.Duration) (Context, CancelFunc)
- func WithTimeoutCause(parent Context, ttl time.Duration, cause error) (Context, CancelFunc)
- type CancelFunc
- type Context
- type Entries
- type Entry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Canceled = context.Canceled DeadlineExceeded = context.DeadlineExceeded )
Functions ¶
func WithCancel ¶
func WithCancel(parent Context) (Context, CancelFunc)
func WithDeadline ¶
func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc)
func WithDeadlineCause ¶
func WithTimeout ¶
func WithTimeout(parent Context, ttl time.Duration) (Context, CancelFunc)
func WithTimeoutCause ¶
Types ¶
type CancelFunc ¶
type CancelFunc context.CancelFunc
type Context ¶
type Context interface { context.Context UserValue(key []byte) any SetUserValue(key []byte, val any) UserValues(fn func(key []byte, val any)) LocalValue(key []byte) any SetLocalValue(key []byte, val any) LocalValues(fn func(key []byte, val any)) }
func WithoutCancel ¶
Click to show internal directories.
Click to hide internal directories.