Skip to main content

Module node

Module node 

Source
Expand description

choir node — the operator half of the command line.

Everything an agent does to a node was already here; everything an operator does to one lived in choirctl, a zsh script with a machine’s habits baked into it. This module is where that half comes back, in the language the rest of the binary is written in.

§Why this is not a wrapper

choirctl status answers its question by spawning about twenty-eight processes: curl twice, launchctl, ps, git, date, awk three times, head five times, and python3 twice to parse JSON that a shell cannot. Each is a fork, an exec, a dynamic link and an interpreter start, and two of them boot Python to read four numbers out of a document this binary already deserializes.

Here the same report is two HTTP requests and a fold over the response. curl stays — the workspace has no HTTP client crate, on purpose, and that is one process per request rather than one per field. Nothing else forks.

§Examples

use choir_cli::node::Health;

// A node that answers 503 on `/healthz` is reporting its own
// durability failure, and that is never softened into a warning.
assert!(!Health::Unhealthy.is_ok());
assert_eq!(Health::Unhealthy.exit_code(), 1);

Enums§

Health
What /healthz said.

Functions§

status
choir node status [<api>].
status_report
The whole report, as choir node status prints it.