-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate services from connectors (#36)
* Separate services from connectors Previously the library attempted to abstract over different HTTP(s) connectors by passing them as generics through various types. Although this allows certain flexibility (e.g. choosing openssl vs rustls), it was probably the wrong abstraction layer in the first place. This change moves most of the genericism to the grpc-service layer for grpc services (bigtable and pubsub). The library's "common" path via builders will provide a sensible default implementation, but it will now be possible to substitute the entire tower::service stack provided to the grpc API. This is more flexible than the prior connector abstraction, but also harder to use (you basically have to build everything yourself). This feels like the right balance between a batteries-included default and a build-your-own option. Along the way I've also made some updates to non-exhaustivity in generated code, to help ease future changes without breaking semver. This is unfortunately less ergonomic, but not _too_ bad. Future changes may include some builder pattern to make protobuf construction easier. The GCS API is still largely the same, however it is still not in an ideal place. Future changes may bring it more towards service abstraction. Finally, this change includes updates to tonic and prost, bringing them up to the latest versions. Supersedes #30 Fixes #35
- Loading branch information
Showing
30 changed files
with
1,555 additions
and
1,140 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "ya-gcp" | ||
version = "0.10.0" | ||
version = "0.11.0" | ||
authors = ["Renar Narubin <[email protected]>"] | ||
edition = "2021" | ||
description = "APIs for using Google Cloud Platform services" | ||
|
@@ -30,10 +30,10 @@ path = "examples/bigtable.rs" | |
required-features = ["bigtable"] | ||
|
||
[features] | ||
default = ["rustls"] | ||
default = ["rustls-native-certs"] | ||
|
||
rustls = ["hyper-rustls"] | ||
openssl = ["hyper-openssl"] # TODO maybe should be native-tls instead? | ||
rustls-native-certs = ["dep:rustls-native-certs", "tonic?/tls-roots"] | ||
webpki-roots = ["dep:webpki-roots", "tonic?/tls-webpki-roots"] | ||
|
||
# an internal feature used by services running grpc | ||
grpc = ["tonic", "prost", "prost-types", "tower", "derive_more"] | ||
|
@@ -51,27 +51,29 @@ futures = "0.3" | |
http = "0.2" | ||
humantime-serde = "1" | ||
hyper = "0.14" | ||
hyper-rustls = "0.24.2" | ||
paste = "1" | ||
rand = "0.8" | ||
rustls = "0.21.8" | ||
serde = { version = "1", features = ["derive"] } | ||
thiserror = "1" | ||
tokio = { version = "1", features = ["time"] } | ||
tracing = "0.1" | ||
yup-oauth2 = "8.1" | ||
tracing = "0.1.37" | ||
yup-oauth2 = "8.3.0" | ||
|
||
async-stream = { version = "0.3", optional = true } | ||
async-channel = { version = "1", optional = true } | ||
derive_more = { version = "0.99", optional = true } | ||
hyper-openssl = { version = "0.9", optional = true } | ||
hyper-rustls = { version = "0.22", features = ["rustls-native-certs"], optional = true } | ||
pin-project = { version = "1.0.11", optional = true } | ||
prost = { version = "0.11", optional = true } | ||
prost-types = { version = "0.11", optional = true } | ||
prost = { version = "0.12.3", optional = true } | ||
prost-types = { version = "0.12.3", optional = true } | ||
rustls-native-certs = { version = "0.6.3", optional = true } | ||
tame-gcs = { version = "0.10.0", optional = true } | ||
tempdir = { version = "0.3", optional = true } | ||
tonic = { version = "0.9", optional = true } | ||
tonic = { version = "0.10.2", optional = true } | ||
tower = { version = "0.4", features = ["make"], optional = true } | ||
uuid = { version = "0.8.1", features = ["v4"], optional = true } | ||
uuid = { version = "1.6", features = ["v4"], optional = true } | ||
webpki-roots = { version = "0.25.3", optional = true } | ||
|
||
[dev-dependencies] | ||
approx = "0.5" | ||
|
@@ -84,12 +86,6 @@ tokio = { version = "1.4.0", features = ["rt-multi-thread", "time", "test-util"] | |
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
tracing-tree = "0.2" | ||
|
||
[package.metadata.cargo-udeps.ignore] | ||
# hyper-openssl is only used (and thus detected) if the feature "openssl" is | ||
# enabled _and_ "rustls" is disabled. CI builds with --all-features, so udeps | ||
# fails unless we ignore the package explicitly | ||
normal = ["hyper-openssl"] | ||
|
||
[package.metadata.docs.rs] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
all-features = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.