package xcontext
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xcontext"
Index ¶
- func ExtractLocalDC(ctx context.Context) string
- func IsIdempotent(ctx context.Context) bool
- func IsNestedCall(ctx context.Context) bool
- func MarkRetryCall(ctx context.Context) context.Context
- func MergeContexts(deadline context.Context, additionalValues context.Context) context.Context
- func ValueOnly(ctx context.Context) context.Context
- func WithCancel(ctx context.Context) (context.Context, context.CancelFunc)
- func WithDone(parent context.Context, done <-chan struct{}) (context.Context, context.CancelFunc)
- func WithIdempotent(ctx context.Context, idempotent bool) context.Context
- func WithLocalDC(ctx context.Context, dc string) context.Context
- func WithTimeout(ctx context.Context, t time.Duration) (context.Context, context.CancelFunc)
- type CancelsGuard
- func NewCancelsGuard() *CancelsGuard
- func (g *CancelsGuard) Cancel()
- func (g *CancelsGuard) WithCancel(ctx context.Context) (context.Context, context.CancelFunc)
- type MergedContexts
Functions ¶
func ExtractLocalDC ¶
func IsIdempotent ¶
func IsNestedCall ¶
func MarkRetryCall ¶
func MergeContexts ¶
MergeContexts returns a context with the deadline from the deadline context and values from both contexts
func ValueOnly ¶
ValueOnly helps to clear parent context from deadlines/cancels
func WithCancel ¶
func WithDone ¶
func WithIdempotent ¶
func WithLocalDC ¶
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 ¶
func (g *CancelsGuard) WithCancel(ctx context.Context) (context.Context, context.CancelFunc)
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.