mesh

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyDir = "/etc/tako/wireguard"
)

Variables

This section is empty.

Functions

func EnsureNodeKeysLocal

func EnsureNodeKeysLocal(ctx context.Context, verbose bool) (string, error)

func EnsureWireGuardTools

func EnsureWireGuardTools(client *ssh.Client, verbose bool) error

func EnsureWireGuardToolsLocal

func EnsureWireGuardToolsLocal(ctx context.Context, verbose bool) error

func EnsureWireGuardToolsWithOutput added in v0.8.0

func EnsureWireGuardToolsWithOutput(client *ssh.Client, verbose bool, out io.Writer) error

EnsureWireGuardToolsWithOutput installs WireGuard tooling, writing progress prose to out (os.Stdout when nil) so machine modes can redirect it.

func RenderConfigTemplate

func RenderConfigTemplate(node Node, peers []Node, config WireGuardConfig) (string, error)

func ValidateInterfaceName

func ValidateInterfaceName(value string) (string, error)

Types

type Node

type Node struct {
	Name      string            `json:"name"`
	Host      string            `json:"host"`
	Address   string            `json:"address"`
	PublicKey string            `json:"publicKey,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
}

type Status

type Status struct {
	Interface  string `json:"interface"`
	Up         bool   `json:"up"`
	PublicKey  string `json:"publicKey,omitempty"`
	ListenPort string `json:"listenPort,omitempty"`
	Peers      int    `json:"peers"`
}

func ApplyLocal

func ApplyLocal(ctx context.Context, node Node, peers []Node, config WireGuardConfig, verbose bool) (*Status, error)

func ReadStatusLocal

func ReadStatusLocal(ctx context.Context, interfaceName string) (*Status, error)

type WireGuardConfig

type WireGuardConfig struct {
	Enabled      bool   `json:"enabled"`
	Interface    string `json:"interface"`
	ListenPort   int    `json:"listenPort"`
	NATTraversal bool   `json:"natTraversal"`
}

Jump to

Keyboard shortcuts

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