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)
| 184 | // byte 1-2: length of typeName |
| 185 | // next len(attr) bytes: value of attr (the type name) |
| 186 | func 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: |