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 ¶
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 ¶
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 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 StatusReader ¶
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.