Help us shape the future of Go! Take the 2026 Go Developer Survey

mesh

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package mesh puts this worker on its project's Mainplane Network: tailscale's engine (wireguard-go, magicsock, the DERP client) on a TUN of its own, with its own state, UDP port, and router, so it runs beside a user's own Tailscale. The coordinator and relay are the harness's, reached over WebSocket at its front door URL, which the harness key proves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean() error

Clean removes what a killed worker left: the hosts block, and on Linux and Windows the rule. Uninstall runs it after the worker stops.

func Status

func Status() (string, error)

Status is what the worker on this machine says of its node.

Types

type Mesh

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

Mesh is this worker's node.

func Up

func Up(dir, harness, secret, name string) (*Mesh, error)

Up brings the node up with its state in dir: the TUN, then the engine. It registers as name with the join secret on first start; the keys in dir register again with none. It follows the harness with key harness through the pointer and moves its control client when the harness moves.

func (*Mesh) Close

func (m *Mesh) Close() error

Close leaves the mesh: the status socket, the hosts block go, the router takes its address, route and rule away, and the TUN goes.

func (*Mesh) Peer

func (m *Mesh) Peer(name string) (netip.Addr, bool)

Peer is the address of the peer named name in the last map, which stays while the coordinator is out of reach.

func (*Mesh) Removed

func (m *Mesh) Removed() <-chan struct{}

Removed is closed once the harness has removed this worker and it has left the mesh.

func (*Mesh) Self

func (m *Mesh) Self() netip.Addr

Self is this node's address in the last map.

Jump to

Keyboard shortcuts

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