Documentation ¶
Index ¶
- type Nil
- type Tree
- func (t *Tree) Delete(key string) (interface{}, bool)
- func (t *Tree) DeletePrefix(prefix string) int
- func (t *Tree) Get(key string) (interface{}, bool)
- func (t *Tree) Insert(key string, value interface{}) bool
- func (t *Tree) Len() int
- func (t *Tree) LongestPrefix(prefix string) (string, interface{}, bool)
- func (t *Tree) Maximum() (string, interface{}, bool)
- func (t *Tree) Minimum() (string, interface{}, bool)
- func (t *Tree) ToDOTGraph() *dot.Graph
- func (t *Tree) ToMap() map[string]interface{}
- func (t *Tree) Walk(fn WalkFn)
- func (t *Tree) WalkPath(path string, fn WalkFn)
- func (t *Tree) WalkPrefix(prefix string, fn WalkFn)
- type WalkFn
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 implements a radix tree.
func (*Tree) DeletePrefix ¶
DeletePrefix deletes the subtree under a prefix Returns how many nodes were deleted. Use this to delete large subtrees efficiently.
func (*Tree) Insert ¶
Insert adds a new entry or updates an existing entry. Returns 'true' if entry was added.
func (*Tree) LongestPrefix ¶
LongestPrefix is like Get, but instead of an exact match, it will return the longest prefix match.
func (*Tree) ToDOTGraph ¶
ToDOTGraph walks the Tree and converts it into a dot.Graph
func (*Tree) WalkPath ¶
WalkPath is used to walk the Tree, but only visiting nodes from the root down to a given leaf.
func (*Tree) WalkPrefix ¶
WalkPrefix walks the Tree under a prefix.
Click to show internal directories.
Click to hide internal directories.