Documentation ¶
Index ¶
- type Key
- type Namespace
- type Range
- type SortOrder
- type Tree
- func (t *Tree) Delete(key *Key) error
- func (t *Tree) Exists(key *Key) (bool, error)
- func (t *Tree) Get(key *Key) ([]byte, error)
- func (t *Tree) Insert(key *Key, value []byte) error
- func (t *Tree) IterateOnRange(rng *Range, reverse bool, fn func(*Key, []byte) error) error
- func (t *Tree) NewMaxTypeForType(tp types.ValueType) byte
- func (t *Tree) NewMaxTypeForTypeDesc(tp types.ValueType) byte
- func (t *Tree) NewMinTypeForType(tp types.ValueType) byte
- func (t *Tree) NewMinTypeForTypeDesc(tp types.ValueType) byte
- func (t *Tree) NewMinValueForType(tp types.ValueType) types.Value
- func (t *Tree) NewMinValueForTypeDesc(tp types.ValueType) types.Value
- func (t *Tree) Put(key *Key, value []byte) error
- func (t *Tree) Truncate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct { Encoded []byte // contains filtered or unexported fields }
func NewEncodedKey ¶
type Range ¶
A Range of keys to iterate on. By default, Min and Max are inclusive. If Exclusive is true, Min and Max are excluded from the results.
type SortOrder ¶
type SortOrder uint64
SortOrder is a 64-bit unsigned integer that represents the sort order (ASC or DESC) of each value in a key. By default, all values are sorted in ascending order. Each bit represents the sort order of the corresponding value in the key. SortOrder is used in a tree to encode keys. It can only support up to 64 values.
type Tree ¶
A Tree is an abstraction over a k-v store that allows manipulating data using high level keys and values of the Chai type system. Trees are used as the basis for tables and indexes. The key of a tree is a composite combination of several values, while the value can be any value of Chai's type system. The tree ensures all keys are sort-ordered according to the rules of the types package operators. A Tree doesn't support duplicate keys.
func NewTransient ¶
func (*Tree) Delete ¶
Delete a key from the tree. If the key doesn't exist, it returns kv.ErrKeyNotFound.
func (*Tree) Insert ¶
Insert adds a key-obj combination to the tree. If the key already exists, it returns kv.ErrKeyAlreadyExists.
func (*Tree) IterateOnRange ¶
IterateOnRange iterates on all keys that are in the given range.