routing

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerList

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

PeerList manages a list of peers for a single hostname and provides simple round-robin selection.

func NewPeerList

func NewPeerList() *PeerList

NewPeerList creates a new peer list.

func (*PeerList) Add

func (pl *PeerList) Add(p iface.Peer)

Add adds a peer to the list if it's not already present.

func (*PeerList) IsEmpty

func (pl *PeerList) IsEmpty() bool

IsEmpty reports whether the peer list has any entries.

func (*PeerList) Remove

func (pl *PeerList) Remove(p iface.Peer)

Remove removes a peer from the list.

func (*PeerList) Select

func (pl *PeerList) Select() (iface.Peer, error)

Select chooses a peer from the list using simple round-robin.

type Table

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

Table holds the dynamic routing information for the mesh.

func NewTable

func NewTable() *Table

NewTable creates a new routing table.

func (*Table) ClearRoutesForPeer

func (t *Table) ClearRoutesForPeer(p iface.Peer)

ClearRoutesForPeer removes all routes associated with a given peer.

func (*Table) GetPeerForHostname

func (t *Table) GetPeerForHostname(hostname string) (iface.Peer, bool)

GetPeerForHostname finds a peer that services the given hostname.

func (*Table) UpdateRoutesForPeer

func (t *Table) UpdateRoutesForPeer(p iface.Peer, version uint64, hostnames []string)

UpdateRoutesForPeer updates the routing table with the hostnames serviced by a peer.

Jump to

Keyboard shortcuts

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