Documentation
¶
Overview ¶
Package mesh is the VM side of dynamic WireGuard mesh updates. weft publishes a VM's full desired wg0 config on the event bus whenever the mesh membership changes; the VM subscribes and re-applies it (replace-set, idempotent). State is pushed whole rather than diffed, so a missed message self-heals on the next publish.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleMessage ¶
HandleMessage decodes a published mesh update and applies it. Pure aside from the injected apply, so the decode/validate path is testable without a kernel or a broker.
Types ¶
type ApplyFunc ¶
ApplyFunc applies a desired WireGuard config to the kernel. The real implementation is network.ApplyWireGuard (Linux); tests inject a stub.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber listens for this VM's mesh updates and applies each one.
func NewSubscriber ¶
NewSubscriber builds a Subscriber for vmID that applies updates via apply.
func (*Subscriber) Start ¶
func (s *Subscriber) Start() (*nats.Subscription, error)
Start subscribes to the VM's mesh subject. The returned subscription is live until unsubscribed or the connection drops.