Expand description
Official Rust SDK for confish.
§Quick start
use confish::Client;
use serde::Deserialize;
#[derive(Deserialize, Debug)]
struct MyConfig {
site_name: String,
max_upload_mb: u32,
maintenance_mode: bool,
}
let client = Client::builder("env_id", "confish_sk_...").build()?;
let config: MyConfig = client.config().fetch().await?;
println!("{config:?}");Modules§
- webhook
- Webhook signature verification.
Structs§
- Action
- An action returned by the actions API.
- Action
Context - Passed to handlers so they can append progress notes to the action’s timeline.
- Action
Update - A single timeline entry on an
Action. - Actions
- Wraps the
/c/{env}/actionsendpoints. - Client
- Asynchronous client for the confish API.
- Client
Builder - Builder for
Client. - Config
- Wraps the
/c/{env}configuration endpoints. - Consume
Options - Configuration for
Actions::consume. - Feed
- Wraps the
/c/{env}/feeds/{slug}/itemsendpoints for a single feed. - Feed
Item - An item returned by the feeds API.
- Feed
Item Input - A single item in a
Feed::replacepayload. - Feed
Replace Result - Counts returned by
Feed::replace. - LogEntry
Input - A single entry in a
Logs::write_batchpayload. - Logs
- Wraps the
/c/{env}/logand/c/{env}/logsendpoints, with one convenience method per level plus batch writing. - Tracing
Guard tracing - Keeps the background sender alive and flushes it on shutdown — hold on to
it for as long as the layer is in use (the tracing-appender
WorkerGuardpattern). - Tracing
Layer tracing - A
tracing_subscriber::Layerthat shipstracingevents to confish as log entries. - Tracing
Layer Builder tracing - Builder for
TracingLayer.
Enums§
- Action
Status - An action’s lifecycle status.
- Error
- All errors the SDK can return.
- LogLevel
- Log severity levels accepted by the logging API (the full RFC 5424 set).
Constants§
- DEFAULT_
BASE_ URL - The default API base URL (
https://confi.sh).
Type Aliases§
- Error
Callback - Callback invoked when listing fails, when ack fails (other than 409), or when a
handler returns an error. The second parameter is
Noneif the failure happened before an action was picked up (e.g. listing failed). - Result