hostsetup

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hostsetup links remote machines to an instance: it edits the config file in place (keeping comments) and checks and prepares the machine over SSH. The CLI wizard (`runner-warden host add`) drives it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHost

func AddHost(src string, h Host) (string, error)

AddHost returns the config text with h appended, its OS section enabled, and its OS added to every [[target]] h serves. Comments and layout stay.

func KeepaliveTask

func KeepaliveTask(distro string) string

KeepaliveTask is the Windows scheduled task that keeps a WSL distro up.

func WSLDistros

func WSLDistros(ctx context.Context, c Commander) ([]string, error)

WSLDistros lists the WSL distros on a Windows machine, default first.

Types

type Check

type Check struct {
	Name   string
	OK     bool
	Detail string
	Fix    func(ctx context.Context) error
	FixMsg string // what Fix does, for the question
}

Check is one finding about a machine. Fix, when set, is a step the wizard can run for the operator (after asking).

func LinuxChecks

func LinuxChecks(ctx context.Context, c Commander, exec string, wslDistro string) []Check

LinuxChecks inspects a Linux machine (or WSL distro) reached through exec: root, systemd, Docker Engine.

func MacChecks

func MacChecks(ctx context.Context, c Commander, tart, vm string) ([]Check, int)

MacChecks inspects a Mac's VM: running, guest agent, Xcode, and the guest user's uid (returned for the config).

func WSLKeepaliveCheck

func WSLKeepaliveCheck(ctx context.Context, c Commander, distro string) Check

WSLKeepaliveCheck reports whether the keepalive task exists, with a Fix that registers it: WSL stops a distro with no session attached, and its running jobs with it.

type Commander

type Commander interface {
	Command(ctx context.Context, cmd, stdin string) (stdout, stderr string, exit int, err error)
}

Commander runs a command line on the machine with stdin (an SSH session).

type Host

type Host struct {
	Kind          Kind
	Name          string
	Address       string
	SSHUser       string
	Targets       []string
	MaxConcurrent int    // linux, wsl, windows
	Exec          string // linux, wsl
	VM            string // macos
	GuestUID      int    // macos
}

Host is everything the config needs for one machine.

func (Host) Block

func (h Host) Block() string

Block renders the host's TOML table.

type Kind

type Kind string

Kind is the type of machine being linked.

const (
	KindLinux   Kind = "linux"   // [[linux.host]] over plain SSH
	KindWSL     Kind = "wsl"     // [[linux.host]] in a WSL distro behind Windows OpenSSH
	KindWindows Kind = "windows" // [[windows.host]]
	KindMac     Kind = "macos"   // [[macos.host]] with a tart VM
)

Machine kinds.

func (Kind) OS

func (k Kind) OS() core.OS

OS is the job OS a kind serves.

type TartVM

type TartVM struct {
	Name    string `json:"Name"`
	Source  string `json:"Source"`
	Running bool   `json:"Running"`
}

TartVM is one VM tart knows on a Mac.

func TartVMs

func TartVMs(ctx context.Context, c Commander, tart string) ([]TartVM, error)

TartVMs lists the Mac's local tart VMs.

Jump to

Keyboard shortcuts

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