golden

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table[V any] []TableItem[V]

Table is a simple and slow route table, implemented as a slice of prefixes and values as a golden reference for bart.

func (Table[V]) AllSorted

func (t Table[V]) AllSorted() []netip.Prefix

func (*Table[V]) Delete

func (t *Table[V]) Delete(pfx netip.Prefix) (exists bool)

func (Table[V]) Get

func (t Table[V]) Get(pfx netip.Prefix) (val V, ok bool)

func (*Table[V]) Insert

func (t *Table[V]) Insert(pfx netip.Prefix, val V)

func (Table[V]) Lookup

func (t Table[V]) Lookup(addr netip.Addr) (val V, ok bool)

func (Table[V]) LookupPrefix

func (t Table[V]) LookupPrefix(pfx netip.Prefix) (val V, ok bool)

func (Table[V]) LookupPrefixLPM

func (t Table[V]) LookupPrefixLPM(pfx netip.Prefix) (lpm netip.Prefix, val V, ok bool)

func (*Table[V]) Overlaps

func (ta *Table[V]) Overlaps(tb *Table[V]) bool

func (Table[V]) OverlapsPrefix

func (t Table[V]) OverlapsPrefix(pfx netip.Prefix) bool

func (*Table[V]) Sort

func (t *Table[V]) Sort()

Sort, inplace by netip.Prefix, all prefixes are in normalized form

func (Table[V]) Subnets

func (t Table[V]) Subnets(pfx netip.Prefix) []netip.Prefix

func (Table[V]) Supernets

func (t Table[V]) Supernets(pfx netip.Prefix) []netip.Prefix

func (*Table[V]) Union

func (ta *Table[V]) Union(tb *Table[V])

func (*Table[V]) Update

func (t *Table[V]) Update(pfx netip.Prefix, cb func(V, bool) V) (val V)

type TableItem

type TableItem[V any] struct {
	Pfx netip.Prefix
	Val V
}

func (TableItem[V]) String

func (g TableItem[V]) String() string

Jump to

Keyboard shortcuts

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