github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/conn/context.go (about)

     1  package conn
     2  
     3  import "context"
     4  
     5  type ctxNoWrappingKey struct{}
     6  
     7  func WithoutWrapping(ctx context.Context) context.Context {
     8  	return context.WithValue(ctx, ctxNoWrappingKey{}, true)
     9  }
    10  
    11  func UseWrapping(ctx context.Context) bool {
    12  	b, ok := ctx.Value(ctxNoWrappingKey{}).(bool)
    13  
    14  	return !ok || !b
    15  }