Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenByteStringBetween ¶
func GenByteStringBetween(prev []byte, next []byte, spacing ByteSpacing) []byte
GenByteStringBetween generates a byte string that sorts between the two input strings. If prev is length 0, it is treated as negative infinity. If next is length 0, it is treated as positive infinity. Importantly, the input strings cannot end with minToken.
func GenerateNEvenlySpacedBytes ¶
GenerateNEvenlySpacedBytes returns an array of n byte slices that evenly split the key space into n pieces.
Types ¶
type ByteSpacing ¶
type ByteSpacing int
ByteSpacing is a type that controls what distribution of generated bytes strings is created with calls to GenByteStringBetween.
const ( // PackedSpacing is used when the generated bytes are intended to be "close" // together in the generated key space. PackedSpacing ByteSpacing = iota // SpreadSpacing is used when the generated bytes are intended to be evenly // spaced out within the generated key space. SpreadSpacing )
func (ByteSpacing) String ¶
func (s ByteSpacing) String() string
Click to show internal directories.
Click to hide internal directories.