cockpitoptions

package
v0.182.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Options

func Options(request Request, deps Dependencies) cockpitfleet.Options

cockpitFleetOptions is what the fleet snapshotter reads on this machine: the projects root and WB home through the local collectors, and other machines from the local copy of the git remote-state store wb.yaml configures, when it does and the copy exists. The snapshot never fetches that copy, so a machine with no remote section, an unlocatable store or a hub provider knows no other machines; the last two are logged once, here. Code-index freshness is read from the lifecycle-hook receipts that wb.yaml's hooks section configures. The receipt stream and queue are located by lifecyclehooks.NewFreshnessReader, which resolves them with the same defaulting function the lifecycle-hook worker and every `wb hooks lifecycle` command use (Dispatcher.defaults, as in DefaultDispatcher), so this daemon's own XDG_STATE_HOME and home are honoured exactly as the worker's are. The machine is named after the remote section's machine, else after hostname's answer ("local" when it has none). cockpit.refresh_interval, when set, is the refresh interval, and cockpit.code_index_provider, when set, names the provider that reports the statistics of each checkout's index (the snapshotter alone asks it). cockpit.pull_request_limit, when set, bounds the pull requests the snapshotter observes on GitHub in one pass and cockpit.pull_request_hourly_budget the observations in a rolling hour, through a prwatch.Watcher. The SSH transport of the other machines runs with the daemon's own seams (daemonCockpitSSH). cockpitFleetOptionsWith is cockpitFleetOptions over the given SSH seams, so a test never holds the runner that starts a real ssh.

Types

type Dependencies

type Dependencies struct {
	Hostname func() (string, error)
	Version  func() string
	Publish  remotepublish.Dependencies
	SSH      SSH
}

func DefaultDependencies

func DefaultDependencies(configPath string, exitFactory func(int, string) error) Dependencies

type Request

type Request struct {
	ProjectsRoot, Home, ConfigPath string
	Config                         wbconfig.CockpitConfig
	Logs                           io.Writer
}

Request binds the daemon's current local roots and configuration.

type SSH

type SSH struct {
	Find   func() (string, error)
	Runner remotessh.Runner
}

SSH is what the SSH transport runs with: what finds the local ssh executable and the runner of it.

Jump to

Keyboard shortcuts

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