conflictindex

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket[E any] struct {
	All      []E
	Static   map[string][]E
	Wildcard []E
}

Bucket stores entries with the same count.

func (*Bucket[E]) Add

func (b *Bucket[E]) Add(staticKey string, hasStaticKey bool, entry E)

Add stores entry in b under staticKey or in the wildcard list.

func (Bucket[E]) Clone

func (b Bucket[E]) Clone(translate func(E) E) Bucket[E]

Clone returns a copy of b with each stored entry replaced by translate(entry).

type Index

type Index[E any] struct {
	ByCount  map[int]*Bucket[E]
	CatchAll Bucket[E]
}

Index groups conflict candidates by route shape so callers only compare entries that can plausibly overlap.

func (*Index[E]) Add

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 (Index[E]) Clone

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).

Jump to

Keyboard shortcuts

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