Documentation
¶
Overview ¶
Package keyenc encodes DynamoDB key attribute values (S, N, B) into byte strings whose lexicographic order matches DynamoDB's key order — so bbolt cursors give range queries for free. The load-bearing property, fuzz-tested:
CompareValues(a, b) == bytes.Compare(Encode(a), Encode(b))
Layout per value: a type byte, then the payload:
S/B: payload with 0x00 escaped as 0x00 0xFF, terminated by 0x00 0x01
(terminator sorts below any escaped or literal byte, so prefixes
sort first).
N: sign class byte (2=positive, 1=zero, 0=negative), then for nonzero:
biased exponent (uint16), then BCD-ish digit bytes terminated by 0x00.
For negatives, exponent and digits are bitwise complemented so
bigger magnitudes sort earlier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareValues ¶
CompareValues orders two key values the way DynamoDB does (needed by tests and by scan segmentation). Mixed types order by type tag, mirroring Encode.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.