diff --git a/Cargo.toml b/Cargo.toml index 1bff82e..19918cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,10 @@ keywords = ["wal", "grpc", "s2", "log", "stream"] repository = "https://github.com/s2-streamstore/s2-sdk-rust" homepage = "https://github.com/s2-streamstore/s2-sdk-rust" +[lib] +name = "s2" +path = "src/lib.rs" + [package.metadata.docs.rs] features = ["connector"] cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] diff --git a/README.md b/README.md index 45390ed..81ec281 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,12 @@ The Rust SDK provides ergonomic wrappers and utilities to interact with the 1. Make a request using SDK client. ```rust - use streamstore::client::{Client, ClientConfig}; - use streamstore::types::ListBasinsRequest; - #[tokio::main] async fn main() -> Result<(), Box> { - let config = ClientConfig::new(""); - let client = Client::new(config); + let config = s2::ClientConfig::new(""); + let client = s2::Client::new(config); - let basins = client.list_basins(ListBasinsRequest::new()).await?; + let basins = client.list_basins(Default::default()).await?; println!("My basins: {:?}", basins); Ok(()) diff --git a/examples/consumer.rs b/examples/consumer.rs index 9e99cb2..8785a89 100644 --- a/examples/consumer.rs +++ b/examples/consumer.rs @@ -1,5 +1,5 @@ use futures::StreamExt; -use streamstore::{ +use s2::{ client::{ClientConfig, StreamClient}, types::{BasinName, ReadSessionRequest}, }; diff --git a/examples/create_basin.rs b/examples/create_basin.rs index abe5047..2447f6e 100644 --- a/examples/create_basin.rs +++ b/examples/create_basin.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use streamstore::{ +use s2::{ client::{Client, ClientConfig}, types::{BasinConfig, BasinName, CreateBasinRequest, RetentionPolicy, StreamConfig}, }; diff --git a/examples/create_stream.rs b/examples/create_stream.rs index c840010..dd0e16d 100644 --- a/examples/create_stream.rs +++ b/examples/create_stream.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{Client, ClientConfig}, types::{BasinName, CreateStreamRequest, StorageClass, StreamConfig}, }; diff --git a/examples/delete_basin.rs b/examples/delete_basin.rs index a2a9c47..286764c 100644 --- a/examples/delete_basin.rs +++ b/examples/delete_basin.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{Client, ClientConfig}, types::{BasinName, DeleteBasinRequest}, }; diff --git a/examples/delete_stream.rs b/examples/delete_stream.rs index 151354f..64e122a 100644 --- a/examples/delete_stream.rs +++ b/examples/delete_stream.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{BasinClient, ClientConfig}, types::{BasinName, DeleteStreamRequest}, }; diff --git a/examples/explicit_trim.rs b/examples/explicit_trim.rs index 58fa936..f1c845f 100644 --- a/examples/explicit_trim.rs +++ b/examples/explicit_trim.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{ClientConfig, StreamClient}, types::{AppendInput, AppendRecordBatch, BasinName, CommandRecord}, }; diff --git a/examples/get_latest_record.rs b/examples/get_latest_record.rs index 1099bfb..02b3489 100644 --- a/examples/get_latest_record.rs +++ b/examples/get_latest_record.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{ClientConfig, StreamClient}, types::{BasinName, ReadLimit, ReadRequest}, }; diff --git a/examples/list_all_basins.rs b/examples/list_all_basins.rs index 0be001a..a530b85 100644 --- a/examples/list_all_basins.rs +++ b/examples/list_all_basins.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{Client, ClientConfig}, types::ListBasinsRequest, }; diff --git a/examples/list_streams.rs b/examples/list_streams.rs index af73aa4..4eea8f1 100644 --- a/examples/list_streams.rs +++ b/examples/list_streams.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{BasinClient, ClientConfig}, types::{BasinName, ListStreamsRequest}, }; diff --git a/examples/producer.rs b/examples/producer.rs index 2ced5aa..ba573a1 100644 --- a/examples/producer.rs +++ b/examples/producer.rs @@ -1,5 +1,5 @@ use futures::StreamExt; -use streamstore::{ +use s2::{ batching::{AppendRecordsBatchingOpts, AppendRecordsBatchingStream}, client::{ClientConfig, StreamClient}, types::{AppendInput, AppendRecord, AppendRecordBatch, BasinName, CommandRecord, FencingToken}, diff --git a/examples/reconfigure_basin.rs b/examples/reconfigure_basin.rs index 069c99a..00874d8 100644 --- a/examples/reconfigure_basin.rs +++ b/examples/reconfigure_basin.rs @@ -1,4 +1,4 @@ -use streamstore::{ +use s2::{ client::{Client, ClientConfig}, types::{BasinConfig, BasinName, ReconfigureBasinRequest, StorageClass, StreamConfig}, }; diff --git a/examples/reconfigure_stream.rs b/examples/reconfigure_stream.rs index 9faf3a3..bcf4cef 100644 --- a/examples/reconfigure_stream.rs +++ b/examples/reconfigure_stream.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use streamstore::{ +use s2::{ client::{BasinClient, ClientConfig}, types::{BasinName, ReconfigureStreamRequest, RetentionPolicy, StreamConfig}, }; diff --git a/src/batching.rs b/src/batching.rs index bc4ce11..21a638d 100644 --- a/src/batching.rs +++ b/src/batching.rs @@ -11,9 +11,9 @@ //! # Example usage //! //! ```no_run -//! # use streamstore::client::*; -//! # use streamstore::types::*; -//! # use streamstore::batching::*; +//! # use s2::client::*; +//! # use s2::types::*; +//! # use s2::batching::*; //! # use std::time::Duration; //! # let config = ClientConfig::new("token"); //! # let basin: BasinName = "my-basin".parse().unwrap(); diff --git a/src/lib.rs b/src/lib.rs index c187c3f..8bb9a73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,4 +12,5 @@ pub mod batching; pub mod client; pub mod types; +pub use client::{BasinClient, Client, ClientConfig, StreamClient}; pub use service::Streaming;