inventory

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: GPL-3.0 Imports: 13 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 inventory lists the machines sshwarm watches, and how to reach them over ssh: from a TOML hosts file, or a Nix flake's deploy.nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(hosts []Host, name string) (int, error)

Find returns the index of the host that name refers to: the one with that exact name, or else the only one whose name contains it. It fails if none does, or if several do.

Types

type Host

type Host struct {
	Name    string   // as the flake or hosts file names it, e.g. web-1
	Address string   // ssh destination, user@hostname
	Opts    []string // extra ssh options
}

Host is a machine sshwarm watches: its name, and how to reach it over ssh.

func LoadFile

func LoadFile(path string) ([]Host, error)

LoadFile reads a TOML hosts file: a [[host]] table per machine, with its name, and optionally the host to reach (the name by default), the ssh user and key. ssh looks up that host in ~/.ssh/config for anything else. The hosts keep the file's order.

func LoadFlake

func LoadFlake(ctx context.Context, flakeDir string) ([]Host, error)

LoadFlake reads deploy.nodes from the flake in flakeDir, with deploy-rs's defaults for sshUser and sshOpts.

func Select

func Select(hosts []Host, names []string) []Host

Select keeps the hosts whose name contains one of names. If no names are given, all hosts are selected.

Jump to

Keyboard shortcuts

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