matcher

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node — single segment in the tree

type Result

type Result struct {
	Route  *alaye.Route
	Params map[string]string
}

Result returned from Find

type Tree

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

Tree — per-host route tree

func NewTree

func NewTree() *Tree

NewTree returns an empty Tree

func (*Tree) Bulk

func (t *Tree) Bulk(routes map[string]*alaye.Route) []error

Bulk inserts multiple routes

func (*Tree) ClearCache

func (t *Tree) ClearCache()

ClearCache clears all cached results

func (*Tree) Find

func (t *Tree) Find(path string) Result

Find returns the best match for a path

func (*Tree) GetPatterns

func (t *Tree) GetPatterns() []string

GetPatterns returns all registered patterns

func (*Tree) Insert

func (t *Tree) Insert(pattern string, route *alaye.Route) error

Insert adds a pattern → route mapping

func (*Tree) Rebuild

func (t *Tree) Rebuild(routes []alaye.Route)

Rebuild clears and rebuilds the tree

func (*Tree) Stats

func (t *Tree) Stats() map[string]any

Stats returns tree statistics

Jump to

Keyboard shortcuts

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