MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / validateKey

Function validateKey

edgraph/server.go:2357–2367  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

2355}
2356
2357func validateKey(key string) error {
2358 switch {
2359 case key == "":
2360 return errors.Errorf("Has zero length")
2361 case strings.ContainsAny(key, "~@"):
2362 return errors.Errorf("Has invalid characters")
2363 case strings.IndexFunc(key, unicode.IsSpace) != -1:
2364 return errors.Errorf("Must not contain spaces")
2365 }
2366 return nil
2367}
2368
2369// validateKeys checks predicate and facet keys in N-Quad for syntax errors.
2370func validateKeys(nq *api.NQuad) error {

Callers 1

validateKeysFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…