Skip to content

Commit 7514023

Browse files
authored
docs: update references in the examples (#333)
Signed-off-by: Mike Nguyen <hey@mike.ee>
1 parent e8806bc commit 7514023

7 files changed

Lines changed: 47 additions & 19 deletions

File tree

examples/README.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,56 @@
11
# Dapr Rust SDK - Examples
22

3-
These examples demonstrates how to use Dapr rust sdk.
3+
These examples demonstrate how to use the Dapr Rust SDK.
44

5+
* [actors](src/actors)
6+
* Demonstrates Dapr actor hosting and actor client calls
7+
* [app-api-token](src/app-api-token)
8+
* Demonstrates inbound auth on an app-callback server with `AppApiTokenLayer`
9+
* [bindings](src/bindings)
10+
* Demonstrates Dapr input and output bindings
511
* [client](src/client)
6-
* Simple dapr client example that saves, gets, and deletes state from the state stores
12+
* Saves, gets, and deletes state with a Dapr client
13+
* [client-config](src/client-config)
14+
* Demonstrates client construction from environment variables, options, and explicit addresses
15+
* [configuration](src/configuration)
16+
* Reads and subscribes to Dapr configuration values
17+
* [conversation-alpha1](src/conversation-alpha1)
18+
* Sends a request to the Dapr conversation alpha1 echo component
19+
* [conversation-alpha2](src/conversation-alpha2)
20+
* Sends a request to the Dapr conversation alpha2 echo component
21+
* [crypto](src/crypto)
22+
* Demonstrates Dapr cryptography operations
23+
* [invoke/grpc](src/invoke/grpc)
24+
* Demonstrates service invocation over gRPC
25+
* [invoke/grpc-proxying](src/invoke/grpc-proxying)
26+
* Demonstrates service invocation through Dapr gRPC proxying
27+
* [jobs](src/jobs)
28+
* Demonstrates Dapr job scheduling
29+
* [jobs-failurepolicy](src/jobs-failurepolicy)
30+
* Demonstrates Dapr job scheduling with a failure policy
731
* [pubsub](src/pubsub)
832
* Publishes and subscribes to events
33+
* [query_state](src/query_state)
34+
* Demonstrates state queries against a query-capable state store
35+
* [secrets-bulk](src/secrets-bulk)
36+
* Retrieves secrets in bulk from a local secret store
937
* [workflow](src/workflow)
1038
* Demonstrates registering, running, waiting for, and purging a workflow
39+
* [workflow-history-propagation](src/workflow-history-propagation)
40+
* Demonstrates propagating workflow history to child workflows and activities
1141
* [workflow-parallel](src/workflow-parallel)
1242
* Demonstrates parallel workflow activity execution
13-
* [workflow-taskexecutionid](src/workflow-taskexecutionid)
14-
* Demonstrates activity retry task execution IDs
1543
* [workflow-sustained](src/workflow-sustained)
1644
* Demonstrates sustained concurrent workflow scheduling
17-
* [workflow-history-propagation](src/workflow-history-propagation)
18-
* Demonstrates propagating workflow history to child workflows and activities
45+
* [workflow-taskexecutionid](src/workflow-taskexecutionid)
46+
* Demonstrates activity retry task execution IDs
1947

2048
## Adding new examples
2149

22-
To add new examples, `Cargo.toml` would have to be updated as follows:
50+
To add new examples, update `examples/Cargo.toml` with an entry like:
2351

24-
```rust
52+
```toml
2553
[[example]]
2654
name = "example-name"
27-
path = "examples/example-name/example.rs"
28-
```
55+
path = "src/example-name/main.rs"
56+
```

examples/src/actors/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ dapr run -f .
135135

136136
1. Start actor host (expose Http server receiver on port 50051):
137137
```bash
138-
dapr run --app-id actor-host --app-protocol http --app-port 50051 cargo run -- --example actors-server
138+
dapr run --app-id actor-host --app-protocol http --app-port 50051 -- cargo run --example actors-server
139139
```
140140

141141
2. Start actor client:
142142
```bash
143-
dapr run --app-id actor-client --dapr-grpc-port 3502 cargo run -- --example actors-client
143+
dapr run --app-id actor-client --dapr-grpc-port 3502 -- cargo run --example actors-client
144144

145145
```

examples/src/client-config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ timeout_seconds: 30
5050
-->
5151

5252
```bash
53-
dapr run --app-id=rustapp --dapr-grpc-port 50001 cargo run -- --example client-config
53+
dapr run --app-id=rustapp --dapr-grpc-port 50001 -- cargo run --example client-config
5454
```
5555

5656
<!-- END_STEP -->

examples/src/client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ timeout_seconds: 30
3333
-->
3434

3535
```bash
36-
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources cargo run -- --example client
36+
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources -- cargo run --example client
3737
```
3838

3939
<!-- END_STEP -->

examples/src/pubsub/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ dapr run -f .
135135

136136
1. Run the subscriber with dapr
137137
```bash
138-
dapr run --app-id rust-subscriber --app-protocol grpc --app-port 50051 cargo run -- --example pubsub-subscriber
138+
dapr run --app-id rust-subscriber --app-protocol grpc --app-port 50051 -- cargo run --example pubsub-subscriber
139139
```
140140

141141
2. Run the publisher with dapr
142142
```bash
143-
dapr run --app-id rust-publisher --app-protocol grpc cargo run -- --example pubsub-publisher
143+
dapr run --app-id rust-publisher --app-protocol grpc -- cargo run --example pubsub-publisher
144144
```

examples/src/query_state/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ sleep: 15
9292
timeout_seconds: 30
9393
-->
9494
```bash
95-
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ cargo run -- --example query-state-1
95+
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ -- cargo run --example query-state-1
9696
```
9797
<!-- END_STEP -->
9898
@@ -126,7 +126,7 @@ sleep: 15
126126
timeout_seconds: 30
127127
-->
128128
```bash
129-
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ cargo run -- --example query-state-2
129+
dapr run --app-id=rustapp --dapr-grpc-port 3501 --resources-path statestore/ -- cargo run --example query-state-2
130130
```
131131
<!-- END_STEP -->
132132

examples/src/secrets-bulk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ timeout_seconds: 30
3434
-->
3535

3636
```bash
37-
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources/ cargo run -- --example secrets-bulk
37+
dapr run --app-id=rustapp --dapr-grpc-port 3500 --resources-path ./resources/ -- cargo run --example secrets-bulk
3838
```
3939

4040
<!-- END_STEP -->

0 commit comments

Comments
 (0)