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

Function TypeKey

x/keys.go:186–189  ·  view source on GitHub ↗

TypeKey returns type key for given type name. Type keys are stored separately with a unique prefix, since we need to iterate over all type keys. The structure of a type key is as follows: byte 0: key type prefix (set to ByteType) byte 1-2: length of typeName next len(attr) bytes: value of attr (the

(attr string)

Source from the content-addressed store, hash-verified

184// byte 1-2: length of typeName
185// next len(attr) bytes: value of attr (the type name)
186func TypeKey(attr string) []byte {
187 key, _ := generateKey(ByteType, attr, 0)
188 return key
189}
190
191// DataKey generates a data key with the given attribute and UID.
192// The structure of a data key is as follows:

Callers 9

writeMethod · 0.92
TestEmptyTypeSchemaFunction · 0.92
updateTypeFunction · 0.92
RootNsTypeKeyFunction · 0.92
DeleteTypeMethod · 0.92
dropDepreciatedFunction · 0.92
fixPersistedQueryFunction · 0.92
FromBackupKeyFunction · 0.85
TestTypeKeyFunction · 0.85

Calls 1

generateKeyFunction · 0.70

Tested by 2

TestEmptyTypeSchemaFunction · 0.74
TestTypeKeyFunction · 0.68