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

Function validateNamespace

edgraph/server.go:2039–2052  ·  view source on GitHub ↗
(ctx context.Context, tc *api.TxnContext)

Source from the content-addressed store, hash-verified

2037}
2038
2039func validateNamespace(ctx context.Context, tc *api.TxnContext) error {
2040 if !x.WorkerConfig.AclEnabled {
2041 return nil
2042 }
2043
2044 ns, err := x.ExtractNamespaceFrom(ctx)
2045 if err != nil {
2046 return err
2047 }
2048 if tc.Hash != getHash(ns, tc.StartTs) {
2049 return x.ErrHashMismatch
2050 }
2051 return nil
2052}
2053
2054func (s *Server) UpdateExtSnapshotStreamingState(ctx context.Context,
2055 req *api.UpdateExtSnapshotStreamingStateRequest) (v *api.UpdateExtSnapshotStreamingStateResponse, err error) {

Callers 1

CommitOrAbortMethod · 0.85

Calls 2

ExtractNamespaceFromFunction · 0.92
getHashFunction · 0.70

Tested by

no test coverage detected