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