1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
11 type contextKeyRequestID struct{}
12 type contextKeyAuthorization struct{}
14 func ContextWithRequestID(ctx context.Context, reqid string) context.Context {
15 return context.WithValue(ctx, contextKeyRequestID{}, reqid)
18 // ContextWithAuthorization returns a child context that (when used
19 // with (*Client)RequestAndDecodeContext) sends the given
20 // Authorization header value instead of the Client's default
22 func ContextWithAuthorization(ctx context.Context, value string) context.Context {
23 return context.WithValue(ctx, contextKeyAuthorization{}, value)