Documentation ¶
Index ¶
- type Tree
- func (tr *Tree) Count() int
- func (tr *Tree) Delete(cell uint64, data interface{})
- func (tr *Tree) DeleteWhen(cell uint64, cond func(data interface{}) bool)
- func (tr *Tree) Insert(cell uint64, data interface{})
- func (tr *Tree) InsertOrReplace(cell uint64, data interface{}, ...)
- func (tr *Tree) Range(start uint64, iter func(cell uint64, data interface{}) bool)
- func (tr *Tree) RangeDelete(start, end uint64, ...)
- func (tr *Tree) Scan(iter func(cell uint64, data interface{}) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a uint64 prefix tree
func (*Tree) DeleteWhen ¶
DeleteWhen removes an item from the tree based on it's cell and when the cond func returns true. It will delete at most a maximum of one item.
func (*Tree) Insert ¶
Insert inserts an item into the tree. Items are ordered by it's cell. The extra param is a simple user context value.
func (*Tree) InsertOrReplace ¶
func (tr *Tree) InsertOrReplace( cell uint64, data interface{}, cond func(data interface{}) (newData interface{}, replace bool), )
InsertOrReplace inserts an item into the tree. Items are ordered by it's cell. The extra param is a simple user context value. The cond function is used to allow for replacing an existing cell with a new cell. When the 'replace' return value is set to false, then the original data is inserted. When the 'replace' value is true the existing cell data is replace with newData.