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

Method attachNamespace

xidmap/xidmap.go:185–198  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

183}
184
185func (m *XidMap) attachNamespace(ctx context.Context) context.Context {
186 if m.dg == nil {
187 return ctx
188 }
189
190 // Need to attach JWT because slash uses alpha as zero proxy.
191 md, ok := metadata.FromOutgoingContext(ctx)
192 if !ok {
193 md = metadata.New(nil)
194 }
195 md.Set("accessJwt", m.dg.GetJwt().AccessJwt)
196 ctx = metadata.NewOutgoingContext(ctx, md)
197 return ctx
198}
199
200func (m *XidMap) relogin() error {
201 if m.dg == nil {

Callers 2

NewFunction · 0.95
BumpToMethod · 0.95

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected