pathtree

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateTrieOnAdd = true

Functions

This section is empty.

Types

type Match

type Match struct {
	Next *Match
	Val  *Node
}

type MatchQueue

type MatchQueue struct {
	First *Match
	Last  *Match
}

func NewMatchQueue

func NewMatchQueue() *MatchQueue

func (*MatchQueue) Add

func (q *MatchQueue) Add(v *Node)

type Node

type Node struct {
	WildNodes  *Node
	NamedNodes map[string]*Node
	FullPath   string
	EndRoute   *route.Route
}

func NewNode

func NewNode() *Node

func (*Node) Add

func (n *Node) Add(spath []string, fullpath string, proute *route.Route) error

func (*Node) Find

func (n *Node) Find(path []string, mq *MatchQueue)

type Trie

type Trie struct {
	Root          *Node
	PathSeparator string
	RawRoutes     map[string]*route.Route
}

func NewTrie

func NewTrie(separator string) *Trie

func (*Trie) Add

func (t *Trie) Add(path string, proute *route.Route) error

func (*Trie) Find

func (t *Trie) Find(path string) *Node

Jump to

Keyboard shortcuts

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