Skip to main content

Crate gunnar_common

Crate gunnar_common 

Source
Expand description

The parts every gunnar binary shares, regardless of which half it is.

The command line (cli), the logging ladder (logging), the build identity (BUILD_REF, ssh_server_id) and the one address the control plane defaults to (DEFAULT_CONTROL_ADDR) are needed by a pure-server build, a pure-client build and the all-in-one alike. They lived in gunnar-cli while it was the only binary crate; they moved here when the server implementation became its own crate, so that gunnar-cli and gunnar-server can both depend on this and neither has to depend on the other.

Nothing here is an implementation of a verb. The Command enum names the verbs and parses their arguments; dispatching them into gunnar-server’s server code or gunnar-cli’s client code stays in those crates.

Modules§

bindspec
Where a listener binds — an address, or an interface resolved at boot. Where a listener binds, when the address is not known until boot.
cli
The gunnar command line, in clap derive.
logging
The log level, changeable on a running server.
logqueue
The console queue: the log lines gunnar writes to stderr go through ONE bounded queue and ONE drainer thread, so no request ever waits for the console to accept a byte.
logtap
Every INFO+ line as a value, for the appliance console dashboard. The log tap: every INFO+ line gunnar logs, handed to ONE in-process reader as a value — the console dashboard (gunnar_server::dashboard).
monetize_key
Where the metered appliance’s verifying key comes from — a file, or the key itself, spelled inline on a kernel command line. Where the metered appliance’s verifying key comes from — a file, or the key itself, spelled inline.

Constants§

AGENT
gunnar/<version>, the string this binary identifies itself with.
BUILD_REF
The build this binary is, as build.rs stamped it: the builder’s passed ref (GUNNAR_BUILD_REF, then the Build Thing’s NORDISK_BUILD_REF), else git describe --tags --always --dirty=-modified --abbrev=7, else unknown.
DEFAULT_CONTROL_ADDR
Where the control plane listens unless told otherwise.

Functions§

init_tracing
Install the tracing subscriber once, honouring RUST_LOG.
ssh_server_id
The SSH identification string, carrying the commit this server is.