tcontext

package
v0.0.0-...-f726f7b Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ContextID = ContextKey("id")

Variables

This section is empty.

Functions

func WithCancel

func WithCancel(parent context.Context, id string) (context.Context, context.CancelFunc)

func WithDeadline

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

func WithTimeout

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

func WithValue

func WithValue(parent context.Context, key interface{}, val interface{}) context.Context

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func From

func From(parent context.Context) Context

func New

func New(id ...string) Context

func WithID

func WithID(parent context.Context, id string) Context

func (Context) Deadline

func (c Context) Deadline() (deadline time.Time, ok bool)

func (Context) Done

func (c Context) Done() <-chan struct{}

func (Context) Err

func (c Context) Err() error

func (Context) ID

func (c Context) ID() string

func (Context) Value

func (c Context) Value(key interface{}) interface{}

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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