Documentation ¶
Index ¶
Constants ¶
const (
INDEX_MAX_STRING_LEN = 64
)
const ( // SmallestNonZeroNormalFloat32 is the smallest positive non-zero floating number. The go package version // has the denormalized form which is higher than this. SmallestNonZeroNormalFloat32 = 0x1p-126 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayValue ¶
type ArrayValue struct {
// contains filtered or unexported fields
}
func NewArrayValue ¶
func NewArrayValue(v []byte, decoded []any) *ArrayValue
func (*ArrayValue) AsInterface ¶
func (a *ArrayValue) AsInterface() interface{}
func (*ArrayValue) String ¶
func (a *ArrayValue) String() string
type BoolValue ¶
type BoolValue bool
func NewBoolValue ¶
func (*BoolValue) AsInterface ¶
func (b *BoolValue) AsInterface() interface{}
type BytesValue ¶
type BytesValue []byte
func NewBytesValue ¶
func NewBytesValue(v []byte) *BytesValue
func (*BytesValue) AsInterface ¶
func (b *BytesValue) AsInterface() interface{}
func (*BytesValue) String ¶
func (b *BytesValue) String() string
type Collation ¶
type Collation struct {
// contains filtered or unexported fields
}
func NewCollation ¶
func NewCollation() *Collation
func NewCollationFrom ¶
func NewSortKeyCollation ¶
func NewSortKeyCollation() *Collation
The collation sort key is used for with the secondary index. We generate a sortkey when storing a string in the index and also use it when comparing strings when filtering.
func (*Collation) CompareString ¶
CompareString returns an integer comparing the two strings. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.
func (*Collation) GenerateSortKey ¶
func (*Collation) IsCaseInsensitive ¶
func (*Collation) IsCaseSensitive ¶
func (*Collation) IsCollationSortKey ¶
type Comparable ¶
type Comparable interface { // CompareTo returns a value indicating the relationship between the receiver and the parameter. // // Returns a negative integer, zero, or a positive integer as the receiver is less than, equal // to, or greater than the parameter i.e. v1.CompareTo(v2) returns -1 if v1 < v2 CompareTo(v Value) (int, error) }
type DoubleValue ¶
type DoubleValue struct { Double float64 // contains filtered or unexported fields }
func NewDoubleUsingFloat ¶
func NewDoubleUsingFloat(v float64) *DoubleValue
func NewDoubleValue ¶
func NewDoubleValue(raw string) (*DoubleValue, error)
func (*DoubleValue) AsInterface ¶
func (d *DoubleValue) AsInterface() interface{}
func (*DoubleValue) String ¶
func (d *DoubleValue) String() string
type IntValue ¶
type IntValue int64
func NewIntValue ¶
func (*IntValue) AsInterface ¶
func (i *IntValue) AsInterface() interface{}
type NullValue ¶
type NullValue struct{}
func NewNullValue ¶
func NewNullValue() *NullValue
func (*NullValue) AsInterface ¶
func (n *NullValue) AsInterface() interface{}
type StringValue ¶
func NewStringValue ¶
func NewStringValue(v string, collation *Collation) *StringValue
func (*StringValue) AsInterface ¶
func (s *StringValue) AsInterface() interface{}
func (*StringValue) String ¶
func (s *StringValue) String() string
type Value ¶
type Value interface { fmt.Stringer Comparable // AsInterface to return the value as interface AsInterface() interface{} }
Value is our value object that implements comparable so that two values can be compared. This is used to build the keys(primary key or any other index key), or to build the selector filter. Note: if the field data type is byte/binary then the value object returned is base64 decoded. The reason is that JSON has encoded the byte array to base64 so to make sure we are using the user provided value in building the key and the filter we must first decode this field. This allows us later to perform prefix scans.