Documentation ¶
Index ¶
- Variables
- func Btoi(b []byte) int64
- func Compare(a, b string) int
- func Equal(a, b string) bool
- func IntToKey(key int64) string
- func IntToVal(val int64) []byte
- func Itob(i int64) []byte
- func KeyToInt(key string) int64
- func ValToInt(val []byte) int64
- type BPTree
- func (t *BPTree) Add(key string, value []byte)
- func (t *BPTree) AddInt(key int64, value int64)
- func (t *BPTree) Close()
- func (t *BPTree) Del(key string) (string, []byte)
- func (t *BPTree) DelInt(key int64) (int64, int64)
- func (t *BPTree) Get(key string) (string, []byte)
- func (t *BPTree) GetClosest(key string) (string, []byte)
- func (t *BPTree) GetInt(key int64) (int64, int64)
- func (t *BPTree) Has(key string) bool
- func (t *BPTree) HasInt(key int64) bool
- func (t *BPTree) Len() int
- func (t *BPTree) Max() (string, []byte)
- func (t *BPTree) Min() (string, []byte)
- func (t *BPTree) Put(key string, value []byte) bool
- func (t *BPTree) PutInt(key int64, value int64) bool
- func (t *BPTree) Range(iter func(k string, v []byte) bool)
- func (t *BPTree) Size() int64
Constants ¶
This section is empty.
Variables ¶
View Source
var ValTypeZero = *new([]byte)
Functions ¶
Types ¶
type BPTree ¶
type BPTree struct {
// contains filtered or unexported fields
}
BPTree represents the root of a b+tree
func (*BPTree) Add ¶
Add inserts a new record using the provided key. It only inserts an entry if the key does not already exist.
func (*BPTree) AddInt ¶
AddInt inserts a new record using the provided integer key and value. It only inserts an entry if the key does not already exist.
func (*BPTree) Has ¶
Has returns a boolean indicating weather or not the provided key and associated record exists.
func (*BPTree) HasInt ¶
HasInt tests and returns a boolean value if the provided key exists in the tree
func (*BPTree) Put ¶
Put is mainly used when you wish to upsert as it assumes the data to already be contained the tree. It will overwrite duplicate keys, as it does not check to see if the key exists
Click to show internal directories.
Click to hide internal directories.