Skip to main content

main

Function main 

Source
pub(crate) fn main() -> Result<()>
Expand description

Starts the exporter in direct WebSocket mode or NATS worker mode.

Reads EXPORTER_MODE, EXPORTER_ADDR and PARQUET_DIR, and prints a warning if the Parquet directory does not exist. Worker mode then hands off to run_worker. Direct mode binds EXPORTER_ADDR and serves the /export WebSocket route with handle_ws until the server stops.

ยงErrors

Returns an error if EXPORTER_MODE is invalid, if the listen address cannot be bound or the server fails (direct mode), or if run_worker fails.