Skip to main content

Module server

Module server 

Source
Expand description

The composition root: the one place an implementation crate is named.

Everything below this file is written against the three ports and the supervision domain’s store traits. This is where one implementation is chosen for each — OctoPrint behind the printer port, Obico behind the vision port, OneHarness behind the supervisor port, and SQLite behind the store traits — and just check-repo refuses any other crate that names one. The store is one implementation held once per aggregate: Stores::of coerces the one SQLite store to each of the five trait objects, and every consumer below is handed the handle for the aggregate it names and no other.

Server::start is that root. Server::start_with takes ports a caller composed, which is how the tiers that stand in for a machine drive the real surface without one; the two share every line after the ports exist, so what a tier drives is the server this file starts.

Structs§

Ports
The four implementations one running server was composed from.
Running
One server, serving.
Server
The composition root.

Enums§

StartError
Why this server did not start.

Constants§

API_CREDENTIAL_FILE
The file, under the state directory, holding the API credential this server generated for itself — read when api.credential is not configured, and written only when it is not there.
CLIENT_CONFIG_FILE
The file this server writes the address it took and the credential in force into, under the state directory, for the clients that run beside it.
CONTEXT_PROGRAM
The program a supervision turn runs to read its print’s context.
PROMPT_FILE
The file name the agent’s prompt template is materialized under.
SCHEMA_FILE
The file name the assessment schema is materialized under.
TURN_PROMPT
The prompt template this program carries and materializes.

Functions§

agent_config
The supervising agent’s configuration, as Server::start composes it.
context_command
The command a supervision turn runs to read its print’s context.