14 releases (9 breaking)
0.11.0 | Feb 22, 2023 |
---|---|
0.10.0 | Oct 19, 2022 |
0.9.0 | Jul 11, 2022 |
0.7.3-alpha.0 | Jan 20, 2022 |
0.1.0-alpha.2 | Oct 29, 2019 |
#9 in #microservices
175 downloads per month
34KB
439 lines
Dapr SDK for Rust
⚠ Work in Progress ⚠
Dapr is a portable, event-driven, serverless runtime for building distributed applications across cloud and edge.
Prerequsites
Usage
[dependencies]
dapr = "0.11.0"
A client can be created as follows:
use dapr;
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get the Dapr port and create a connection
let port: u16 = std::env::var("DAPR_GRPC_PORT")?.parse()?;
let addr = format!("https://127.0.0.1:{}", port);
// Create the client
let mut client = dapr::Client::<dapr::client::TonicClient>::connect(addr).await?;
Try out examples
Building
To build
cargo build
Note: The proto buf client generation is built into
cargo build
process so updating the proto files underdapr/
is enough to update the proto buf client.
To refresh .proto files from upstream dapr
- Just need to run update-protos.sh, which will basically fetch latest proto updates.
- By default, it picks from master proto. To specify a particular release/version, please specify with a -v flag
./update-protos.sh -v v1.10.1
Dependencies
~6–10MB
~171K SLoC