Documentation
¶
Overview ¶
Package radixtree implements an adaptive radix tree.
Index ¶
- type ScanOption
- type Tree
- func (t *Tree[K, V]) Compact()
- func (t *Tree[K, V]) Delete(key K) bool
- func (t *Tree[K, V]) Get(key K) (V, bool)
- func (t *Tree[K, V]) Len() int
- func (t *Tree[K, V]) LongestPrefix(key K) (K, V, bool)
- func (t *Tree[K, V]) Scan(prefix K, opts ...ScanOption) iter.Seq2[K, V]
- func (t *Tree[K, V]) Set(key K, val V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScanOption ¶
type ScanOption func(*scanConfig)
ScanOption modifies the behavior of the iterator returned from Scan.
type Tree ¶
A Tree is a key-value store that also supports querying by key prefix. The zero value is an empty Tree ready to use. A Tree is not safe for concurrent use or copying.
func (*Tree[K, V]) Compact ¶
func (t *Tree[K, V]) Compact()
Compact frees memory associated with deleted keys. Compact is an expensive operation; call it after many Deletes, not after each Delete.
func (*Tree[K, V]) Delete ¶
Delete removes the value for a key, and reports whether the key existed. Delete does not free all memory associated with the key. Consider calling Compact after many Deletes.
func (*Tree[K, V]) LongestPrefix ¶
LongestPrefix returns the longest key that prefixes the input key, the value for that key, and reports whether any such key exists.