Skip to main content

ndjson_rpc/
lib.rs

1//! Line-delimited JSON-RPC framing (`{ id, verb, args }` ↔
2//! `{ id, result | error | event | end }`) with two interchangeable
3//! transports — a Unix-domain-socket server / client for local
4//! control planes, and an HTTP/1.1 server / client that streams the
5//! same frames as `Transfer-Encoding: chunked` NDJSON.
6//!
7//! See the README for the gap this fills (daemon ↔ CLI control planes
8//! that everyone re-implements).
9
10pub mod client;
11pub mod http_client;
12pub mod http_server;
13pub mod protocol;
14pub mod server;
15
16pub use client::{MgmtClientError, UnixMgmtClient};
17pub use http_client::HttpMgmtClient;
18pub use http_server::{HttpServerConfig, HttpServerError, spawn_http_server};
19pub use protocol::{
20	EndMarker, Request, Response, ResponseOutcome, WireError, WireErrorKind, encode_line,
21};
22pub use server::{DispatchOutcome, EventStream, Handler, spawn_unix_server};