context

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package context contains generated code by adptool.

Index

Constants

This section is empty.

Variables

View Source
var (
	Canceled         = context.Canceled
	DeadlineExceeded = context.DeadlineExceeded
)

Functions

func AfterFunc

func AfterFunc(ctx context.Context, f func()) (stop func() bool)

func Background

func Background() context.Context

func Cause

func Cause(c context.Context) error

func FromCreatedBy

func FromCreatedBy(ctx context.Context) string

FromCreatedBy returns the creator ID from the context.

func FromID

func FromID(ctx context.Context) string

FromID returns the object ID from the context.

func FromRowLock

func FromRowLock(ctx context.Context) bool

FromRowLock returns the row lock flag from the context.

func FromToken

func FromToken(ctx context.Context) string

FromToken returns the token from the context.

func FromTrace

func FromTrace(ctx context.Context) string

FromTrace returns the trace ID from the context.

func FromTrans

func FromTrans(ctx context.Context) bool

FromTrans returns the transaction flag from the context.

func NewCreatedBy

func NewCreatedBy(ctx context.Context, id string) context.Context

NewCreatedBy creates a new context with the creator ID.

func NewID

func NewID(ctx context.Context, id string) context.Context

NewID creates a new context with the object ID.

func NewRowLock

func NewRowLock(ctx context.Context, lock bool) context.Context

NewRowLock creates a new context with the row lock flag.

func NewToken

func NewToken(ctx context.Context, token string) context.Context

NewToken creates a new context with the token.

func NewTrace

func NewTrace(ctx context.Context, traceID string) context.Context

NewTrace creates a new context with the given trace ID.

func NewTrans

func NewTrans(ctx context.Context, trans bool) context.Context

NewTrans creates a new context with the transaction flag.

func TODO

func TODO() context.Context

func WithCancel

func WithCancel(parent context.Context) (ctx context.Context, cancel context.CancelFunc)

func WithCancelCause

func WithCancelCause(parent context.Context) (ctx context.Context, cancel context.CancelCauseFunc)

func WithDeadline

func WithDeadline(parent context.Context, d time.Time) (context.Context, context.CancelFunc)

func WithDeadlineCause

func WithDeadlineCause(parent context.Context, d time.Time, cause error) (context.Context, context.CancelFunc)

func WithTimeout

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

func WithTimeoutCause

func WithTimeoutCause(parent context.Context, timeout time.Duration, cause error) (context.Context, context.CancelFunc)

func WithValue

func WithValue(parent context.Context, key, val any) context.Context

func WithoutCancel

func WithoutCancel(parent context.Context) context.Context

Types

type CancelCauseFunc

type CancelCauseFunc = context.CancelCauseFunc

type CancelFunc

type CancelFunc = context.CancelFunc

type Context

type Context = context.Context

func NewContext

func NewContext(ctx context.Context) Context

NewContext creates a new context with common runtime values.

Jump to

Keyboard shortcuts

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