package xcontext

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"

Index

Functions

func ExtractLocalDC

func ExtractLocalDC(ctx context.Context) string

func IsIdempotent

func IsIdempotent(ctx context.Context) bool

func IsNestedCall

func IsNestedCall(ctx context.Context) bool

func MarkRetryCall

func MarkRetryCall(ctx context.Context) context.Context

func MergeContexts

func MergeContexts(deadline context.Context, additionalValues context.Context) context.Context

MergeContexts returns a context with the deadline from the deadline context and values from both contexts

func ValueOnly

func ValueOnly(ctx context.Context) context.Context

ValueOnly helps to clear parent context from deadlines/cancels

func WithCancel

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

func WithDone

func WithDone(parent context.Context, done <-chan struct{}) (context.Context, context.CancelFunc)

func WithIdempotent

func WithIdempotent(ctx context.Context, idempotent bool) context.Context

func WithLocalDC

func WithLocalDC(ctx context.Context, dc string) context.Context

func WithTimeout

Types

type CancelsGuard

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

func NewCancelsGuard

func NewCancelsGuard() *CancelsGuard

func (*CancelsGuard) Cancel

func (g *CancelsGuard) Cancel()

func (*CancelsGuard) WithCancel

type MergedContexts

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

func (*MergedContexts) Deadline

func (ctx *MergedContexts) Deadline() (deadline time.Time, ok bool)

func (*MergedContexts) Done

func (ctx *MergedContexts) Done() <-chan struct{}

func (*MergedContexts) Err

func (ctx *MergedContexts) Err() error

func (*MergedContexts) Value

func (ctx *MergedContexts) Value(key interface{}) interface{}

Source Files

cancels_quard.go context_error.go context_with_cancel.go context_with_timeout.go done.go idempotent.go local_dc.go merge_contexts.go retry_call.go value_only.go

Version
v3.108.4
Published
May 20, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
2 hours ago

Tools for package owners.