Expand description
Rust client for cloacina-server (CLOACI-I-0113 / T-0646).
Extracted from cloacinactl’s crate-private client so external services
consume the same surface the CLI does. DTOs come from
[cloacina-api-types] — the same crate the server’s handlers build their
responses from, so request/response shapes cannot drift.
use cloacina_client::ClientBuilder;
let client = ClientBuilder::new("http://localhost:8080")
.api_key("clk_...")
.tenant("public")
.build()?;
let accepted = client
.execute_workflow("my_workflow", serde_json::json!({"input": 42}))
.await?;
use futures_util::StreamExt;
let mut events = std::pin::pin!(client.follow_execution_events(&accepted.execution_id));
while let Some(event) = events.next().await {
println!("{:?}", event?);
}Re-exports§
pub use cloacina_api_types as types;
Structs§
- Client
- Typed client for the cloacina-server REST API + delivery WebSocket.
Cheap to clone (everything behind one
Arc). - Client
Builder - Builder for
Client. - Delivery
Push - One decoded delivery push.
- Subscribe
Options - Options for
Client::subscribe_delivery.
Enums§
- Client
Error - Errors from the cloacina-server client.
Constants§
- DELIVERY_
PROTOCOL_ VERSION - Wire-protocol version for the substrate envelope. Bumped on backwards-incompatible changes; carried on every frame so peers can negotiate or refuse.
Functions§
- resolve_
api_ key_ scheme - Resolve an api-key value that may carry a scheme prefix —
env:VAR,file:/path, or a literal key.keyring:is deferred (CLOACI-I-0098 non-goals).