package
Version:
v0.3.3
Opens a new window with list of versions in this module.
Published: Aug 2, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Bucket[E any] struct {
All []E
Static map[string][]E
Wildcard []E
}
Bucket stores entries with the same count.
Add stores entry in b under staticKey or in the wildcard list.
Clone returns a copy of b with each stored entry replaced by translate(entry).
Index groups conflict candidates by route shape so callers only compare
entries that can plausibly overlap.
func (i *Index[E]) Add(count int, staticKey string, hasStaticKey, hasCatchAll bool, entry E)
Add stores entry in the count bucket and, when hasCatchAll is true, in the
catch-all bucket.
func (i Index[E]) Clone(translate func(E) E) Index[E]
Clone returns a copy of i with each stored entry replaced by translate(entry).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.