tinybtree
Just an itsy bitsy b-tree.
Usage
Keys are strings, values are interfaces.
Functions
Get(key string) (value interface{}, gotten bool)
Set(key string, value interface{}) (prev interface{}, replaced bool)
Delete(key string) (prev interface{}, deleted bool)
Scan(iter func(key string, value interface{}) bool)
Ascend(pivot string, iter func(key string, value interface{}) bool)
Descend(pivot string, iter func(key string, value interface{}) bool)
Example
var tr tinybtree.BTree
prev, ok := tr.Set("hello", "world")
value, ok := tr.Get("hello")
prev, ok := tr.Delete("hello")
Contact
Josh Baker @tidwall
License
tinybtree
source code is available under the MIT License.