pathtrie

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pattern

type Pattern struct {
	Parts []string
	Count uint64
}

Pattern is a generalized path pattern with its occurrence count.

func (Pattern) String

func (p Pattern) String() string

type Trie

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

Trie auto-collapses high-cardinality path segments into wildcards.

func New

func New(highCardinalityThreshold int) *Trie

New creates a Trie with the given high-cardinality threshold. When a node has more children than threshold, they collapse into "*".

func (*Trie) Insert

func (t *Trie) Insert(path string, sep string)

Insert adds a path (split by separator) into the trie.

func (*Trie) InsertParts

func (t *Trie) InsertParts(parts []string, count uint64)

InsertParts inserts pre-split path parts with a count.

func (*Trie) Patterns

func (t *Trie) Patterns() []Pattern

Patterns returns all accumulated patterns.

Jump to

Keyboard shortcuts

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