host

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 15 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 host is the Mac the command line runs on, or a test's stand-in for it: its clock, identity, notifications, launchd, the background cleanup and drain it starts, its Tart and its login's stores, and the timings serve and dockhand console keep (Timings). MachineHost is the real one, and the one place that imports Tart, the Keychain, and macOS (part 4, item 2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Timings Timings
	// Now is the clock serve's daily work reads.
	Now func() time.Time
	// Identity is who serve's GitHub login acts as now, read afresh each
	// time it's asked.
	Identity func(*github.Runtime) func(context.Context) (string, error)
	// Executable is the file a long-lived serve watches for an upgrade;
	// a drain ends by itself, and watches none.
	Executable func(drain bool) string
	// Notify shows a notification.
	Notify func(title, text string) error
	// Launchctl runs launchctl for serve's agent (macos.LaunchAgent), and
	// returns what it wrote, nil being launchctl's own.
	Launchctl func(ctx context.Context, args ...string) ([]byte, error)
	// os is the operating system serve --install targets.
	OS string
	// StartCleanup starts dockhand clean --automatic after a command, and
	// startDrain dockhand serve --drain where check -d finds no serve
	// leading, returning its process's ID.
	StartCleanup func(engine.Options) error
	StartDrain   func(engine.Options) (int, error)
	// Look finds a program by name in place of compose's own lookup
	// (compose.Dependencies.Look); nil, as the Mac's host has it, for the
	// command line's PATH.
	Look func(string) (string, error)
	// TartImages, when set, stands in for dockhand's Tart images.
	TartImages TartImages
	// TartSupported is whether this Mac takes Tart (tart.Supported).
	TartSupported func() bool
	// LocalSupported is whether this machine builds in a MacPorts prefix,
	// a Mac's (local.Supported).
	LocalSupported func() bool
	// The login's parts: its device flow, where it's kept, the client
	// reading it, and the browser its page opens in.
	AuthFlow    credential.DeviceFlow
	AuthStore   github.LoginStore
	AuthAPI     func(github.Signin) *github.Client
	OpenBrowser func(ctx context.Context, address string) error
}

Host is what a command line reads of the Mac it runs on, beyond the engine compose assembles: its clock and timings, its login's keeping, its notifications and launchd, and Tart. A run is given one, the Mac's own (machineHost) unless a test stands in its own.

func MachineHost

func MachineHost(look func(name string) string) *Host

MachineHost is the Mac's own host, with the programs its login's keeping and the browser run where look finds them on the command line's PATH (compose.Options.LookPath).

type TartImages

type TartImages interface {
	Status(ctx context.Context) (tart.Status, error)
	Setup(ctx context.Context, options tart.SetupOptions, progress io.Writer) (tart.SetupResult, error)
	Xcodes() (string, bool)
	DownloadXcode(ctx context.Context, missing *tart.MissingXcode, in io.Reader, out, errs io.Writer) (string, error)
}

TartImages is what setup and setup tart ask of dockhand's Tart images.

type Timings

type Timings struct {
	// ServePoll is how often serve looks for work and a standby for the
	// leader; serveGrace how long its executable may be missing before
	// serve takes dockhand as uninstalled; serveIdentity how often it
	// reads who its login acts as. How often it reads your pull requests
	// and runs automatic cleanup are the engine's (ServeOptions).
	ServePoll, ServeGrace, ServeIdentity time.Duration
	// WatchPoll is how often dockhand console looks at the journal.
	WatchPoll time.Duration
	// FollowPoll is how often logs --follow reads the log again.
	FollowPoll time.Duration
	// MigrationPoll is how often a serve waiting on a person's answer to
	// its database's migration tries the database again.
	MigrationPoll time.Duration
}

Timings are how often the long-running commands look again.

Jump to

Keyboard shortcuts

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