Skip to content

Commit

Permalink
chore: update to http 1.x crates
Browse files Browse the repository at this point in the history
This requires updating prost crates to 0.13.x, tonic to 0.12.x and
prost-wkt-* to 0.6.*.

Only the examples still pull in http 0.x, due to
seanmonstar/warp#1090, but that shouldn't affect
consumers of bigtable_rs.

Co-Authored-By: Connor Brewster <[email protected]>
  • Loading branch information
flokli and cbrewster committed Aug 24, 2024
1 parent 5c5107a commit de2a37d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
19 changes: 10 additions & 9 deletions bigtable_rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ readme = "../README.md"

[dependencies]
# tonic, prost, and prost-types are need for build generated rs files
http = "0.2.11"
http = "1.1.0"
hyper-util = { version = "0.1.7", features = ["tokio"] }
tokio = { version = "1.25.0", features = ["rt-multi-thread"] }
tonic = { version = "0.11.0", features = ["tls", "transport"] }
tonic = { version = "0.12.1", features = ["tls", "transport"] }
tower = { version = "0.4" }
prost = "0.12.2"
prost-types = "0.12.2"
prost-wkt = "0.5.0"
prost-wkt-types = "0.5.0"
prost = "0.13.1"
prost-types = "0.13.1"
prost-wkt = { version = "0.6.0" }
prost-wkt-types = { version = "0.6.0" }
serde = { version = "1.0.192", features = ["derive"] }
serde_with = { version = "3.4.0", features = ["base64"] }
# end of above part
Expand All @@ -34,6 +35,6 @@ serde_json = "1.0.85"
serde_path_to_error = "0.1.8"

[build-dependencies]
tonic-build = { version = "0.11.0", features = ["cleanup-markdown"] }
prost-build = "0.12.2"
prost-wkt-build = "0.5.0"
tonic-build = { version = "0.12.1", features = ["cleanup-markdown"] }
prost-build = "0.13.1"
prost-wkt-types = { version = "0.6.0" }
3 changes: 1 addition & 2 deletions bigtable_rs/src/auth_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use gcp_auth::TokenProvider;
use http::{HeaderValue, Request, Response};
use log::debug;
use tonic::body::BoxBody;
use tonic::transport::Body;
use tonic::transport::Channel;
use tower::Service;

Expand All @@ -33,7 +32,7 @@ impl AuthSvc {
}

impl Service<Request<BoxBody>> for AuthSvc {
type Response = Response<Body>;
type Response = Response<BoxBody>;
type Error = Box<dyn std::error::Error + Send + Sync>;
#[allow(clippy::type_complexity)]
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;
Expand Down
8 changes: 7 additions & 1 deletion bigtable_rs/src/bigtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,13 @@ impl BigTableConnection {

let path: String = path.to_string();
let connector = tower::service_fn({
move |_: tonic::transport::Uri| UnixStream::connect(path.clone())
move |_: tonic::transport::Uri| {
let path = path.clone();
async move {
let stream = UnixStream::connect(path).await?;
Ok::<_, std::io::Error>(hyper_util::rt::TokioIo::new(stream))
}
}
});

endpoint.connect_with_connector_lazy(connector)
Expand Down

0 comments on commit de2a37d

Please sign in to comment.