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

Function ValueType

x/values.go:26–39  ·  view source on GitHub ↗

ValueType s a helper function to decide value type of DirectedEdge/Posting/N-Quad.

(hasValue, hasLang, hasSpecialId bool)

Source from the content-addressed store, hash-verified

24
25// ValueType s a helper function to decide value type of DirectedEdge/Posting/N-Quad.
26func ValueType(hasValue, hasLang, hasSpecialId bool) ValueTypeInfo {
27 switch {
28 case hasValue && hasLang:
29 return ValueMulti
30 case hasValue && !hasLang:
31 return ValuePlain
32 case !hasValue && hasSpecialId:
33 return ValueEmpty
34 case !hasValue && !hasSpecialId:
35 return ValueUid
36 default:
37 return ValueUnknown
38 }
39}

Callers 2

valueTypeMethod · 0.92
TestValueTypeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestValueTypeFunction · 0.68