Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add examples for API #113

Merged
merged 13 commits into from
Dec 16, 2024
168 changes: 0 additions & 168 deletions examples/basic.rs

This file was deleted.

21 changes: 21 additions & 0 deletions examples/delete_basin.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use streamstore::{
client::{Client, ClientConfig},
types::{BasinName, DeleteBasinRequest},
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let token = std::env::var("S2_AUTH_TOKEN")?;
let config = ClientConfig::new(token);
let client = Client::new(config);

let basin: BasinName = "my-basin".parse()?;

let delete_basin_request = DeleteBasinRequest::new(basin)
// Don't error if the basin doesn't exist.
.with_if_exists(true);

client.delete_basin(delete_basin_request).await?;

Ok(())
}
Loading