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

Function writeAttr

x/keys.go:141–149  ·  view source on GitHub ↗
(buf []byte, attr string)

Source from the content-addressed store, hash-verified

139}
140
141func writeAttr(buf []byte, attr string) []byte {
142 AssertTrue(len(attr) < math.MaxUint16)
143 binary.BigEndian.PutUint16(buf[:2], uint16(len(attr)))
144
145 rest := buf[2:]
146 AssertTrue(len(attr) == copy(rest, attr))
147
148 return rest[len(attr):]
149}
150
151// genKey creates the key and writes the initial bytes (type byte, length of attribute,
152// and the attribute itself). It leaves the rest of the key empty for further processing

Callers 1

generateKeyFunction · 0.70

Calls 2

copyFunction · 0.85
AssertTrueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…