Skip to main content

Crate cloacina_client

Crate cloacina_client 

Source
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).
ClientBuilder
Builder for Client.
DeliveryPush
One decoded delivery push.
SubscribeOptions
Options for Client::subscribe_delivery.

Enums§

ClientError
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).