Skip to content

Commit

Permalink
[ISSUE #452] feat(rust): implement producer (#453)
Browse files Browse the repository at this point in the history
* feat(rust): implement producer

* add licence to model.rs

* setup protoc in rust build

* make rpc client testable
  • Loading branch information
ShadowySpirits committed Apr 4, 2023
1 parent 0a55ef5 commit 33c069f
Show file tree
Hide file tree
Showing 12 changed files with 1,134 additions and 372 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
working-directory: ./rust
run: cargo build
Expand Down
32 changes: 24 additions & 8 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,33 @@ edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }
tonic = {version = "0.7", features = ["tls", "default", "channel", "tls-roots"]}
prost = "0.10"
prost-types = "0.10"
tokio-rustls = {version = "0.24.0", features = ["default", "dangerous_configuration"] }
async-trait = "0.1.68"
tonic = {version = "0.9.0", features = ["tls", "default", "channel", "tls-roots"]}
prost = "0.11.8"
prost-types = "0.11.8"

thiserror = "1.0"
slog = {version = "2.7.0", features=["max_level_trace", "release_max_level_info"]}
slog-term = "2.9.0"
slog-async = "2.7.0"
anyhow = "1.0.70"
parking_lot = "0.12"
hmac = "0.12"
hostname = "0.3.1"
tokio-rustls = {version = "0.23", features = ["default", "dangerous_configuration"] }

slog = {version = "2.7.0", features=["max_level_trace", "release_max_level_info"]}
slog-term = "2.9.0"
slog-async = "2.7.0"
slog-json = "2.6.1"

opentelemetry = { version = "0.19.0", features = ["metrics", "rt-tokio"] }
opentelemetry-otlp = { version = "0.12.0", features = ["metrics", "grpc-tonic"] }

minitrace = "0.4.1"

mockall = "0.11.4"

[build-dependencies]
tonic-build = "0.7"
tonic-build = "0.9.0"

[dev-dependencies]
wiremock-grpc = "0.0.3-alpha2"
futures = "0.3"
2 changes: 1 addition & 1 deletion rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ fn main() {
],
&["proto"],
)
.unwrap();
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
}
Loading

0 comments on commit 33c069f

Please sign in to comment.