Skip to content

Commit 017e889

Browse files
committed
init docs
Signed-off-by: mikeee <[email protected]>
1 parent bef6e3b commit 017e889

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

daprdocs/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Dapr Rust SDK documentation
2+
3+
This page covers how the documentation is structured for the Dapr Rust SDK
4+
5+
## Dapr Docs
6+
7+
All Dapr documentation is hosted at [docs.dapr.io](https://docs.dapr.io), including the docs for the [Rust SDK](https://docs.dapr.io/developing-applications/sdks/rust/). Head over there if you want to read the docs.
8+
9+
### Rust SDK docs source
10+
11+
Although the docs site code and content is in the [docs repo](https://github.com/dapr/docs), the Go SDK content and images are within the `content` and `static` directories, respectively.
12+
13+
This allows separation of roles and expertise between maintainers, and makes it easy to find the docs files you are looking for.
14+
15+
## Writing Rust SDK docs
16+
17+
To get up and running to write Go SDK docs, visit the [docs repo](https://github.com/dapr/docs) to initialize your environment. It will clone both the docs repo and this repo, so you can make changes and see it rendered within the site instantly, as well as commit and PR into this repo.
18+
19+
Make sure to read the [docs contributing guide](https://docs.dapr.io/contributing/contributing-docs/) for information on style/semantics/etc.
20+
21+
## Docs architecture
22+
23+
The docs site is built on [Hugo](https://gohugo.io), which lives in the docs repo. This repo is setup as a git submodule so that when the repo is cloned and initialized, the rust repo, along with the docs, are cloned as well.
24+
25+
Then, in the Hugo configuration file, the `daprdocs/content` and `daprdocs/static` directories are redirected to the `daprdocs/developing-applications/sdks/rust` and `static/go` directories, respectively. Thus, all the content within this repo is folded into the main docs site.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
type: docs
3+
title: "Contributing to the Rust SDK"
4+
linkTitle: "Rust SDK"
5+
weight: 3000
6+
description: Guidelines for contributing to the Dapr Rust SDK
7+
---
8+
9+
When contributing to the [Go SDK](https://github.com/dapr/go-sdk) the following rules and best-practices should be followed.
10+
11+
## Examples
12+
13+
The `examples` directory contains code samples for users to run to try out specific functionality of the various Go SDK packages and extensions. When writing new and updated samples keep in mind:
14+
15+
- All examples should be runnable on Windows, Linux, and MacOS. While Go code is consistent among operating systems, any pre/post example commands should provide options through [codetabs]({{< ref "contributing-docs.md#tabbed-content" >}})
16+
- Contain steps to download/install any required pre-requisites. Someone coming in with a fresh OS install should be able to start on the example and complete it without an error. Links to external download pages are fine.
17+
- Examples should be pass validation and include mechanical markdown steps and be added to the validation workflow [TBA](#)
18+
19+
## Docs
20+
21+
The `daprdocs` directory contains the markdown files that are rendered into the [Dapr Docs](https://docs.dapr.io) website. When the documentation website is built this repo is cloned and configured so that its contents are rendered with the docs content. When writing docs keep in mind:
22+
23+
- All rules in the [docs guide]({{< ref contributing-docs.md >}}) should be followed in addition to these.
24+
- All files and directories should be prefixed with `go-` to ensure all file/directory names are globally unique across all Dapr documentation.
25+
26+
## Update Protobufs
27+
28+
To pull the protobufs from the `dapr/dapr` repo you can run the script in the repo root like so:
29+
30+
```bash
31+
./update-protos.sh
32+
```
33+
34+
By default, the script fetches the latest proto updates from the master branch of the Dapr repository. If you need to choose a specific release or version, use the -v flag:
35+
36+
```bash
37+
./update-protos.sh -v v1.13.0
38+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
type: docs
3+
title: "Dapr Rust SDK"
4+
linkTitle: "Rust"
5+
weight: 1000
6+
description: Rust SDK packages for developing Dapr applications
7+
no_list: true
8+
cascade:
9+
github_repo: https://github.com/dapr/rust-sdk
10+
github_subdir: daprdocs/content/en/rust-sdk-docs
11+
path_base_for_github_subdir: content/en/developing-applications/sdks/rust/
12+
github_branch: main
13+
---
14+
15+
A client library to help build Dapr applications using Rust. This client is targeting support of all public Dapr APIs while focusing on idiomatic Rust experiences and developer productivity.
16+
17+
{{< cardpane >}}
18+
{{< card title="**Client**">}}
19+
Use the Rust Client SDK for invoking public Dapr APIs
20+
21+
[**Learn more about the Rust Client SDK**]({{< ref rust-client >}})
22+
{{< /card >}}
23+
{{< /cardpane >}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
type: docs
3+
title: "Getting started with the Dapr client Rust SDK"
4+
linkTitle: "Client"
5+
weight: 20000
6+
description: How to get up and running with the Dapr Rust SDK
7+
no_list: true
8+
---
9+
10+
The Dapr client package allows you to interact with other Dapr applications from a Go application.
11+
12+
## Prerequisites
13+
14+
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
15+
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
16+
- [Rust installed](https://www.rust-lang.org/tools/install)
17+
18+
19+
## Import the client package
20+
21+
Add Dapr to your `cargo.toml`
22+
23+
```toml
24+
[dependencies]
25+
# Other dependencies
26+
dapr = "0.13.0"
27+
```
28+
29+
You can either reference `dapr::Client` or bind the full path to a new name as follows:
30+
```rust
31+
use dapr::Client as DaprClient
32+
```
33+
34+
## Related links
35+
[Rust SDK Examples](https://github.com/dapr/rust-sdk/tree/master/examples)

0 commit comments

Comments
 (0)