Skip to content

Commit

Permalink
chore: Rename [lib] to s2 (#120)
Browse files Browse the repository at this point in the history
So we can use it as `s2::*`

---------

Signed-off-by: Vaibhav Rabber <[email protected]>
  • Loading branch information
vrongmeal authored Dec 19, 2024
1 parent 43cce8d commit fb114f6
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 21 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn std::error::Error>> {
let config = ClientConfig::new("<YOUR AUTH TOKEN>");
let client = Client::new(config);
let config = s2::ClientConfig::new("<YOUR AUTH TOKEN>");
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(())
Expand Down
2 changes: 1 addition & 1 deletion examples/consumer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use futures::StreamExt;
use streamstore::{
use s2::{
client::{ClientConfig, StreamClient},
types::{BasinName, ReadSessionRequest},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/create_basin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use streamstore::{
use s2::{
client::{Client, ClientConfig},
types::{BasinConfig, BasinName, CreateBasinRequest, RetentionPolicy, StreamConfig},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/create_stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{Client, ClientConfig},
types::{BasinName, CreateStreamRequest, StorageClass, StreamConfig},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/delete_basin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{Client, ClientConfig},
types::{BasinName, DeleteBasinRequest},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/delete_stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{BasinClient, ClientConfig},
types::{BasinName, DeleteStreamRequest},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/explicit_trim.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{ClientConfig, StreamClient},
types::{AppendInput, AppendRecordBatch, BasinName, CommandRecord},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/get_latest_record.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{ClientConfig, StreamClient},
types::{BasinName, ReadLimit, ReadRequest},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/list_all_basins.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{Client, ClientConfig},
types::ListBasinsRequest,
};
Expand Down
2 changes: 1 addition & 1 deletion examples/list_streams.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{BasinClient, ClientConfig},
types::{BasinName, ListStreamsRequest},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/producer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use futures::StreamExt;
use streamstore::{
use s2::{
batching::{AppendRecordsBatchingOpts, AppendRecordsBatchingStream},
client::{ClientConfig, StreamClient},
types::{AppendInput, AppendRecord, AppendRecordBatch, BasinName, CommandRecord, FencingToken},
Expand Down
2 changes: 1 addition & 1 deletion examples/reconfigure_basin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use streamstore::{
use s2::{
client::{Client, ClientConfig},
types::{BasinConfig, BasinName, ReconfigureBasinRequest, StorageClass, StreamConfig},
};
Expand Down
2 changes: 1 addition & 1 deletion examples/reconfigure_stream.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use streamstore::{
use s2::{
client::{BasinClient, ClientConfig},
types::{BasinName, ReconfigureStreamRequest, RetentionPolicy, StreamConfig},
};
Expand Down
6 changes: 3 additions & 3 deletions src/batching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ pub mod batching;
pub mod client;
pub mod types;

pub use client::{BasinClient, Client, ClientConfig, StreamClient};
pub use service::Streaming;

0 comments on commit fb114f6

Please sign in to comment.