Skip to main content

Crate lightshuttle_control

Crate lightshuttle_control 

Source
Expand description

Local HTTP control plane and dashboard for LightShuttle.

This crate hosts the developer-facing control surface that runs alongside the orchestrator: a REST API, a WebSocket log stream and an SSR dashboard served on 127.0.0.1. CLI subcommands such as lightshuttle restart are thin clients of the same endpoints.

At v0.2.0 this crate exposes GET /healthz plus REST endpoints under /api/resources*; subsequent PRs land the WebSocket log channel, the restart endpoint and the dashboard.

Structs§

ApiError
Translates LifecycleHandleError variants into HTTP status + JSON body. Kept as a plain struct (not an enum) because every handler reduces failures to one of three buckets: not found, not yet implemented, or runtime fault.
ApiErrorBody
Wire representation of an API error.
ControlServer
HTTP server hosting the control plane.
ControlState
State shared by every route of the control plane.
Metrics
Holds the Prometheus render handle and the process start instant.

Functions§

bind
Bind a TCP listener on addr. Pass a port of 0 to let the OS pick a free port; read it back from TcpListener::local_addr.
observe_event_duration
Observe the seconds a resource took to become healthy. Safe to call from anywhere once the recorder is installed; a no-op when no recorder is present.