MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / makeScalarNode

Method makeScalarNode

query/outputnode.go:221–229  ·  view source on GitHub ↗

makeScalarNode returns a fastJsonNode with all of its meta data, scalarVal populated.

(attr uint16, val []byte, list bool)

Source from the content-addressed store, hash-verified

219
220// makeScalarNode returns a fastJsonNode with all of its meta data, scalarVal populated.
221func (enc *encoder) makeScalarNode(attr uint16, val []byte, list bool) (fastJsonNode, error) {
222 fj := enc.newNode(attr)
223 if err := enc.setScalarVal(fj, val); err != nil {
224 return nil, err
225 }
226 enc.setList(fj, list)
227
228 return fj, nil
229}
230
231func (enc *encoder) makeUidNode(attr uint16, uid uint64) (*node, error) {
232 fj := enc.newNode(attr)

Callers 2

AddListValueMethod · 0.95
buildTestTreeFunction · 0.80

Calls 3

newNodeMethod · 0.95
setScalarValMethod · 0.95
setListMethod · 0.95

Tested by 1

buildTestTreeFunction · 0.64