MCPcopy
hub / github.com/containerd/containerd / withTTRPCNamespaceHeader

Function withTTRPCNamespaceHeader

pkg/namespaces/ttrpc.go:30–39  ·  view source on GitHub ↗
(ctx context.Context, namespace string)

Source from the content-addressed store, hash-verified

28)
29
30func withTTRPCNamespaceHeader(ctx context.Context, namespace string) context.Context {
31 md, ok := ttrpc.GetMetadata(ctx)
32 if !ok {
33 md = ttrpc.MD{}
34 } else {
35 md = md.Clone()
36 }
37 md.Set(TTRPCHeader, namespace)
38 return ttrpc.WithMetadata(ctx, md)
39}
40
41func fromTTRPCHeader(ctx context.Context) (string, bool) {
42 return ttrpc.GetMetadataValue(ctx, TTRPCHeader)

Callers 2

TestTTRPCNamespaceHeaderFunction · 0.85
WithNamespaceFunction · 0.85

Calls 2

GetMetadataMethod · 0.80
SetMethod · 0.65

Tested by 1

TestTTRPCNamespaceHeaderFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…