contextimpl

package
v0.0.0-...-dc85c0f Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Canceled = errors.New("context canceled")
View Source
var DeadlineExceeded = errors.New("deadline exceeded")

Functions

func WithCancel

func WithCancel(parent Context) (Context, CancelFunc)

func WithDeadline

func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc)

func WithTimeout

func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)

Types

type CancelFunc

type CancelFunc func()

type Context

type Context interface {
	Deadline() (deadline time.Time, ok bool)
	Done() <-chan struct{}
	Err() error
	Value(key interface{}) interface{}
}

func Background

func Background() Context

func TODO

func TODO() Context

func WithValue

func WithValue(parent Context, key, value interface{}) Context

Jump to

Keyboard shortcuts

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