MCPcopy
hub / github.com/grafana/tempo / applyHeadersGRPC

Function applyHeadersGRPC

cmd/tempo-cli/shared.go:174–185  ·  view source on GitHub ↗
(ctx context.Context, headers []string)

Source from the content-addressed store, hash-verified

172}
173
174func applyHeadersGRPC(ctx context.Context, headers []string) context.Context {
175 parsed := parseHeaders(headers)
176 if len(parsed) == 0 {
177 return ctx
178 }
179 md, _ := metadata.FromOutgoingContext(ctx)
180 md = md.Copy()
181 for _, kv := range parsed {
182 md.Set(kv[0], kv[1])
183 }
184 return metadata.NewOutgoingContext(ctx, md)
185}
186
187func httpScheme(secure bool) string {
188 if secure {

Callers 8

TestApplyHeadersGRPCFunction · 0.85
searchGRPCMethod · 0.85
searchGRPCMethod · 0.85
searchGRPCMethod · 0.85
queryRangeGRPCMethod · 0.85
queryInstantGRPCMethod · 0.85

Calls 2

parseHeadersFunction · 0.85
SetMethod · 0.65

Tested by 3

TestApplyHeadersGRPCFunction · 0.68