MCPcopy Create free account
hub / github.com/cortexproject/cortex / MapFromContext

Function MapFromContext

pkg/util/requestmeta/context.go:24–30  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

22}
23
24func MapFromContext(ctx context.Context) map[string]string {
25 requestContextMap, ok := ctx.Value(requestMetadataContextKey).(map[string]string)
26 if !ok {
27 return nil
28 }
29 return requestContextMap
30}
31
32// ContextWithRequestMetadataMapFromHeaders adds MetadataContext headers to context and Removes non-existent headers.
33// targetHeaders is passed for backwards compatibility, otherwise header keys should be in header itself.

Calls 1

ValueMethod · 0.45