trie

package
v0.0.0-...-c39e8e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2022 License: AGPL-3.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

type Trie struct {
	// contains filtered or unexported fields
}

Trie is a trie. Each branch split is a string rather than a letter.

func New

func New() *Trie

New creates a new trie.

func (*Trie) Add

func (t *Trie) Add(route []string, value string) bool

Add adds a new routed value into the trie.

func (*Trie) Find

func (t *Trie) Find(route []string) (match []string, v string)

Find looks for the longest prefix match for the route.

func (*Trie) FindExact

func (t *Trie) FindExact(route []string) string

FindExact looks for the value of a particular route. Returns empty string if not found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL