container

package
v0.0.0-...-96ff825 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trie

type Trie struct {
	Segment    string
	Pool       *route.EndpointPool
	ChildNodes map[string]*Trie
	Parent     *Trie
}

package name inspired by golang package that includes heap, list and ring.

func NewTrie

func NewTrie() *Trie

func (*Trie) Delete

func (r *Trie) Delete(uri route.Uri) bool

func (*Trie) EachNodeWithPool

func (r *Trie) EachNodeWithPool(f func(*Trie))

func (*Trie) EndpointCount

func (r *Trie) EndpointCount() int

func (*Trie) Find

func (r *Trie) Find(uri route.Uri) *route.EndpointPool

Find returns a *route.EndpointPool that matches exactly the URI parameter, nil if no match was found.

func (*Trie) Insert

func (r *Trie) Insert(uri route.Uri, value *route.EndpointPool) *Trie

func (*Trie) MatchUri

func (r *Trie) MatchUri(uri route.Uri) *route.EndpointPool

MatchUri returns the longest route that matches the URI parameter and has endpoints, nil if nothing matches.

func (*Trie) PoolCount

func (r *Trie) PoolCount() int

func (*Trie) PruneDeadLeaves

func (r *Trie) PruneDeadLeaves()

func (*Trie) Snip

func (r *Trie) Snip()

Snip removes an empty EndpointPool from a node and trims empty leaf nodes from the Trie

func (*Trie) ToMap

func (r *Trie) ToMap() map[route.Uri]*route.EndpointPool

func (*Trie) ToPath

func (r *Trie) ToPath() string

Jump to

Keyboard shortcuts

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