utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 1 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[k any] struct {
	// contains filtered or unexported fields
}

Trie represents a prefix tree for efficient route matching

func NewTrie

func NewTrie[k any]() *Trie[k]

NewTrie creates a new trie

func (*Trie[k]) FindLongestMatch

func (t *Trie[k]) FindLongestMatch(path string) k

FindLongestMatch finds the route with the longest matching prefix

func (*Trie[k]) Insert

func (t *Trie[k]) Insert(pathPrefix string, route k)

Insert adds a route to the trie

type TrieNode

type TrieNode[k any] struct {
	// contains filtered or unexported fields
}

TrieNode represents a node in the prefix trie

Jump to

Keyboard shortcuts

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