Skip to content

Commit 9c7fb3a

Browse files
authored
fix: 同步 Volo-gRPC Volo-Thrift 教程的 Cargo.toml 示例到官方volo init命令生成的 Cargo.toml (#1359)
1 parent e2d221c commit 9c7fb3a

4 files changed

Lines changed: 102 additions & 54 deletions

File tree

content/en/docs/volo/volo-grpc/getting-started/_index.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,28 +170,26 @@ async fn main() {
170170

171171
Then add the required dependencies to the `Cargo.toml` file, which looks like this:
172172

173-
```toml
173+
```toml {hl_lines=["17-19"]}
174174
[package]
175-
name = "volo-example"
175+
name = "volo_example"
176176
version = "0.1.0"
177-
edition = "2021"
177+
edition.workspace = true
178178

179179
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
180180

181181
[dependencies]
182-
anyhow = "1"
183-
async-trait = "0.1"
184-
lazy_static = "1"
185-
tokio = { version = "1", features = ["full"] }
186-
tracing = "0.1"
187-
prost = "0.11"
188-
tracing-subscriber = "0.3"
182+
volo-gen = { path = "./volo-gen" }
189183

190-
pilota = "*"
191-
volo = "*" # we recommend to use the latest framework version for new features and bug fixes
192-
volo-grpc = "*" # we recommend to use the latest framework version for new features and bug fixes
184+
volo.workspace = true
185+
volo-grpc.workspace = true
186+
pilota.workspace = true
193187

194-
volo-gen = { path = "./volo-gen" }
188+
anyhow.workspace = true
189+
tokio = { workspace = true, features = ["full"] }
190+
tracing = "0.1.41"
191+
lazy_static = "1.5.0"
192+
tracing-subscriber = "0.3.19"
195193

196194
[profile.release]
197195
opt-level = 3
@@ -207,6 +205,20 @@ rpath = false
207205
[workspace]
208206
members = ["volo-gen"]
209207
resolver = "2"
208+
209+
[workspace.package]
210+
edition = "2021"
211+
212+
[workspace.dependencies]
213+
# we recommend to use the latest framework version for new features and bug fixes
214+
volo = "*"
215+
volo-build = "*"
216+
volo-grpc = "*"
217+
pilota = "*"
218+
219+
anyhow = "1"
220+
futures = "0.3"
221+
tokio = "1"
210222
```
211223

212224
Then, **create a new terminal** and run the following command to start our server:

content/en/docs/volo/volo-thrift/getting-started/_index.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,27 +169,26 @@ async fn main() {
169169

170170
Then add the required dependencies to the `Cargo.toml` file, which looks like this:
171171

172-
```toml
172+
```toml {hl_lines=["17-19"]}
173173
[package]
174-
name = "volo-example"
174+
name = "volo_example"
175175
version = "0.1.0"
176-
edition = "2021"
176+
edition.workspace = true
177177

178178
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
179179

180180
[dependencies]
181-
anyhow = "1"
182-
async-trait = "0.1"
183-
lazy_static = "1"
184-
tokio = { version = "1", features = ["full"] }
185-
tracing = "0.1"
186-
tracing-subscriber = "0.3"
181+
volo-gen = { path = "./volo-gen" }
187182

188-
pilota = "*"
189-
volo = "*" # we recommend to use the latest framework version for new features and bug fixes
190-
volo-thrift = "*" # we recommend to use the latest framework version for new features and bug fixes
183+
volo.workspace = true
184+
volo-thrift.workspace = true
185+
pilota.workspace = true
191186

192-
volo-gen = { path = "./volo-gen" }
187+
anyhow.workspace = true
188+
tokio = { workspace = true, features = ["full"] }
189+
tracing-subscriber = "0.3.19"
190+
lazy_static = "1.5.0"
191+
tracing = "0.1.41"
193192

194193
[profile.release]
195194
opt-level = 3
@@ -205,6 +204,19 @@ rpath = false
205204
[workspace]
206205
members = ["volo-gen"]
207206
resolver = "2"
207+
208+
[workspace.package]
209+
edition = "2021"
210+
211+
[workspace.dependencies]
212+
# we recommend to use the latest framework version for new features and bug fixes
213+
volo = "*"
214+
volo-build = "*"
215+
volo-thrift = "*"
216+
pilota = "*"
217+
218+
anyhow = "1"
219+
tokio = "1"
208220
```
209221

210222
Then, **create a new terminal** and run the following command to start our server:

content/zh/docs/volo/volo-grpc/getting-started/_index.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,26 @@ async fn main() {
171171

172172
然后,在 `Cargo.toml` 文件中加入所需的依赖,加入后的文件如下:
173173

174-
```toml
174+
```toml {hl_lines=["17-19"]}
175175
[package]
176-
name = "volo-example"
176+
name = "volo_example"
177177
version = "0.1.0"
178-
edition = "2021"
178+
edition.workspace = true
179179

180180
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
181181

182182
[dependencies]
183-
anyhow = "1"
184-
async-trait = "0.1"
185-
lazy_static = "1"
186-
tokio = { version = "1", features = ["full"] }
187-
tracing = "0.1"
188-
prost = "0.11"
189-
tracing-subscriber = "0.3"
183+
volo-gen = { path = "./volo-gen" }
190184

191-
pilota = "*"
192-
volo = "*" # we recommend to use the latest framework version for new features and bug fixes
193-
volo-grpc = "*" # we recommend to use the latest framework version for new features and bug fixes
185+
volo.workspace = true
186+
volo-grpc.workspace = true
187+
pilota.workspace = true
194188

195-
volo-gen = { path = "./volo-gen" }
189+
anyhow.workspace = true
190+
tokio = { workspace = true, features = ["full"] }
191+
tracing = "0.1.41"
192+
lazy_static = "1.5.0"
193+
tracing-subscriber = "0.3.19"
196194

197195
[profile.release]
198196
opt-level = 3
@@ -208,6 +206,20 @@ rpath = false
208206
[workspace]
209207
members = ["volo-gen"]
210208
resolver = "2"
209+
210+
[workspace.package]
211+
edition = "2021"
212+
213+
[workspace.dependencies]
214+
# we recommend to use the latest framework version for new features and bug fixes
215+
volo = "*"
216+
volo-build = "*"
217+
volo-grpc = "*"
218+
pilota = "*"
219+
220+
anyhow = "1"
221+
futures = "0.3"
222+
tokio = "1"
211223
```
212224

213225
接着,**新建一个 terminal**,执行以下命令,把我们的 server 端跑起来:

content/zh/docs/volo/volo-thrift/getting-started/_index.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,27 +171,26 @@ async fn main() {
171171

172172
然后,在 `Cargo.toml` 文件中加入所需的依赖,加入后的文件如下:
173173

174-
```toml
174+
```toml {hl_lines=["17-19"]}
175175
[package]
176-
name = "volo-example"
176+
name = "volo_example"
177177
version = "0.1.0"
178-
edition = "2021"
178+
edition.workspace = true
179179

180180
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
181181

182182
[dependencies]
183-
anyhow = "1"
184-
async-trait = "0.1"
185-
lazy_static = "1"
186-
tokio = { version = "1", features = ["full"] }
187-
tracing = "0.1"
188-
tracing-subscriber = "0.3"
183+
volo-gen = { path = "./volo-gen" }
189184

190-
pilota = "*"
191-
volo = "*" # we recommend to use the latest framework version for new features and bug fixes
192-
volo-thrift = "*" # we recommend to use the latest framework version for new features and bug fixes
185+
volo.workspace = true
186+
volo-thrift.workspace = true
187+
pilota.workspace = true
193188

194-
volo-gen = { path = "./volo-gen" }
189+
anyhow.workspace = true
190+
tokio = { workspace = true, features = ["full"] }
191+
tracing-subscriber = "0.3.19"
192+
lazy_static = "1.5.0"
193+
tracing = "0.1.41"
195194

196195
[profile.release]
197196
opt-level = 3
@@ -207,6 +206,19 @@ rpath = false
207206
[workspace]
208207
members = ["volo-gen"]
209208
resolver = "2"
209+
210+
[workspace.package]
211+
edition = "2021"
212+
213+
[workspace.dependencies]
214+
# we recommend to use the latest framework version for new features and bug fixes
215+
volo = "*"
216+
volo-build = "*"
217+
volo-thrift = "*"
218+
pilota = "*"
219+
220+
anyhow = "1"
221+
tokio = "1"
210222
```
211223

212224
接着,**新建一个 terminal**,执行以下命令,把我们的 server 端跑起来:

0 commit comments

Comments
 (0)