meshpath

package
v0.2.0-beta.18 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package meshpath answers one question for the ingress and application controllers: can this control plane reach a remote node's published ports over the WireGuard mesh right now, and on which address.

Index

Constants

View Source
const StaleAfter = 3 * time.Minute

StaleAfter is how old a WireGuard handshake may be before the path counts as down. Persistent keepalive keeps a healthy peer well inside it.

Variables

This section is empty.

Functions

func ValidateBindIP

func ValidateBindIP(ip string) error

ValidateBindIP is the single guard every mesh bind goes through: only a concrete unicast address may be bound, never a wildcard, loopback or multicast one, so a mesh bind can never widen a port to every interface.

Types

type NodeStore

type NodeStore interface {
	GetNode(ctx context.Context, id string) (*store.Node, error)
}

NodeStore is the slice of the store the tracker needs.

type Path

type Path struct {
	// Local is true for the control plane's own node, which needs no mesh.
	Local bool
	// Usable is true when Address can be dialed and bound to right now.
	Usable bool
	// Address is the node's mesh IP, set only when Usable.
	Address string
	// Reason says why the path is not usable, with the next action.
	Reason string
}

Path is the mesh route from this control plane to one node.

type Resolver

type Resolver interface {
	Path(ctx context.Context, nodeID string) (Path, error)
}

Resolver reports the mesh path to a node.

type StatusReader

type StatusReader interface {
	Status(ctx context.Context) (network.Status, error)
}

StatusReader is the slice of network.Mesh the tracker needs.

type Tracker

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

Tracker derives Paths from the control plane's live WireGuard device.

func NewTracker

func NewTracker(localID string, mesh StatusReader, nodes NodeStore) *Tracker

NewTracker builds a Tracker. mesh may be nil when mesh networking is off.

func (*Tracker) Path

func (t *Tracker) Path(ctx context.Context, nodeID string) (Path, error)

Path implements Resolver.

Jump to

Keyboard shortcuts

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