github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/xcontext/local_dc.go (about) 1 package xcontext 2 3 import "context" 4 5 type localDcKey struct{} 6 7 func WithLocalDC(ctx context.Context, dc string) context.Context { 8 return context.WithValue(ctx, localDcKey{}, dc) 9 } 10 11 func ExtractLocalDC(ctx context.Context) string { 12 if val := ctx.Value(localDcKey{}); val != nil { 13 return val.(string) 14 } 15 16 return "" 17 }