7 unstable releases (3 breaking)
0.5.1 | Dec 20, 2024 |
---|---|
0.5.0 | Dec 19, 2024 |
0.4.1 | Dec 17, 2024 |
0.3.1 | Dec 12, 2024 |
0.2.0 | Dec 10, 2024 |
#286 in Database interfaces
1,142 downloads per month
Used in streamstore-cli
275KB
5.5K
SLoC
The Rust SDK provides ergonomic wrappers and utilities to interact with the S2 API.
Getting started
-
Ensure you have
tokio
added as a dependency. The SDK relies on Tokio for executing async code.cargo add tokio --features full
-
Add the
streamstore
dependency to your project:cargo add streamstore
-
Generate an authentication token by logging onto the web console at s2.dev.
-
Make a request using SDK client.
#[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let config = s2::ClientConfig::new("<YOUR AUTH TOKEN>"); let client = s2::Client::new(config); let basins = client.list_basins(Default::default()).await?; println!("My basins: {:?}", basins); Ok(()) }
Examples
The examples
directory in this repository contains a variety of
example use cases demonstrating how to use the SDK effectively.
Run any example using the following command:
export S2_AUTH_TOKEN="<YOUR AUTH TOKEN>"
cargo run --example <example_name>
[!NOTE] You might want to update the basin name in the example before running since basin names are globally unique and each example uses the same basin name (
"my-favorite-basin"
).
SDK Docs and Reference
Head over to docs.rs for detailed documentation and crate reference.
Feedback
We use Github Issues to track feature requests and issues with the SDK. If you wish to provide feedback, report a bug or request a feature, feel free to open a Github issue.
Contributing
Developers are welcome to submit Pull Requests on the repository. If there is no tracking issue for the bug or feature request corresponding to the PR, we encourage you to open one for discussion before submitting the PR.
Reach out to us
Join our Discord server. We would love to hear from you.
You can also email us at hi@s2.dev.
License
This project is licensed under the Apache-2.0 License.
Dependencies
~16–27MB
~482K SLoC