Documentation ¶
Overview ¶
Package ixkey handles specifying and encoding index key strings that are directly comparable. Single field index keys are not encoded. But a single value for a multi-field index still needs to be encoded. Fields are separated by two zero bytes 0,0. Zero bytes are encoded as 0,1. Normally the values will be packed, but this is not required as long as they compare directly. If a resulting entry is longer than maxEntry it will panic.
Index ¶
Constants ¶
const Max = "\xff\xff\xff\xff\xff\xff\xff\xff"
const Min = ""
const Sep = "\x00\x00"
Variables ¶
This section is empty.
Functions ¶
func DecodeValues ¶
func DecodeValues(comp string) []Value
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder builds keys incrementally. Zero value is ready to use. Note: Do not use this for single field keys - they should not be encoded.
type Spec ¶
type Spec struct { // Fields specifies the fields in the key. Fields []int // Fields2 is used for unique indexes (that allow multiple empty keys). // It will only be used if all of the Fields value are empty. Fields2 []int }
Spec specifies the field(s) in an index key
func (*Spec) Compare ¶
Compare compares the specified fields of the two records without building keys for them