Documentation
¶
Index ¶
- Variables
- type Mapping
- type Trie
- func (t *Trie[T]) Depth() int
- func (t *Trie[T]) Get(key []byte) (val T, current *Mapping[T], finish bool)
- func (t *Trie[T]) Keys() [][]byte
- func (t *Trie[T]) Mapping() (m *Mapping[T])
- func (t *Trie[T]) MatchWithReader(r io.Reader) (handler T, prefix []byte, err error)
- func (t *Trie[T]) Put(key []byte, val T) (finish bool)
- func (t *Trie[T]) Size() int
- func (t *Trie[T]) String() string
- func (t *Trie[T]) Walk(f func(k []byte, v T))
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = fmt.Errorf("not found")
)
Functions ¶
This section is empty.
Types ¶
type Mapping ¶ added in v0.2.0
type Mapping[T any] struct { // contains filtered or unexported fields }
Mapping is a getter of the trie.
type Trie ¶
type Trie[T any] struct { // contains filtered or unexported fields }
Trie is a trie tree implementation.
func (*Trie[T]) MatchWithReader ¶ added in v0.3.0
MatchWithReader returns most matching handler and prefix bytes data to use for the given reader.
Click to show internal directories.
Click to hide internal directories.