MCPcopy
hub / github.com/dgraph-io/dgraph / AttachNamespace

Function AttachNamespace

x/x.go:467–475  ·  view source on GitHub ↗

AttachNamespace adds given namespace to the metadata of the context.

(ctx context.Context, namespace uint64)

Source from the content-addressed store, hash-verified

465
466// AttachNamespace adds given namespace to the metadata of the context.
467func AttachNamespace(ctx context.Context, namespace uint64) context.Context {
468 md, ok := metadata.FromIncomingContext(ctx)
469 if !ok {
470 md = metadata.New(nil)
471 }
472 ns := strconv.FormatUint(namespace, 10)
473 md.Set("namespace", ns)
474 return metadata.NewIncomingContext(ctx, md)
475}
476
477// AttachJWTNamespaceOutgoing attaches the namespace in the JWT claims to the outgoing metadata of
478// the context.

Callers 9

GetGQLSchemaFunction · 0.92
UpdateGQLSchemaFunction · 0.92
ResetPasswordMethod · 0.92
authenticateLoginMethod · 0.92
refreshAclCacheFunction · 0.92
upsertGuardianAndGrootFunction · 0.92
ExpandEdgesFunction · 0.92
AttachJWTNamespaceFunction · 0.85

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected