File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ module.exports = {
120120 "/guide/v2/3.2.node" ,
121121 "/guide/v2/3.3.mesh" ,
122122 "/guide/v2/3.4.web" ,
123+ "/guide/v2/3.5.client" ,
123124 ] ,
124125 } ,
125126 {
Original file line number Diff line number Diff line change 66
77 - Linux/macOS下自动安装Go多版本管理器(适用于 bash、zsh)
88
9- ``` shell
9+ ``` bash
1010 $ curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash
1111 $ cat << 'EOF ' >> ~/.bashrc
1212 # 可选。检查g别名是否被占用
1919
2020 - Windows下自动安装Go多版本管理器(适用于 pwsh)
2121
22- ```shell
22+ ```bash
2323 $ iwr https://raw.githubusercontent.com/voidint/g/master/install.ps1 -useb | iex
2424 ```
2525
26262. 安装Go编译器
2727
28- ```shell
28+ ```bash
2929 $ g install 1.22.9
3030 ```
3131
3535
3636 - Linux, using apt or apt-get, for example:
3737
38- ```shell
38+ ```bash
3939 $ apt install -y protobuf-compiler
4040 $ protoc --version # Ensure compiler version is 3+
4141 ```
4242
4343 - MacOS, using Homebrew:
4444
45- ```shell
45+ ```bash
4646 $ brew install protobuf
4747 $ protoc --version # Ensure compiler version is 3+
4848 ```
5151
52522. 安装protobuf go代码生成工具(使用场景:开发mesh微服务、使用protobuf作为与客户端通信的协议)
5353
54- ```shell
54+ ```bash
5555 go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
5656 ```
5757
58583. 安装grpc代码生成工具(使用场景:使用[GRPC](https://grpc.io/)组件开发mesh微服务)
5959
60- ```shell
60+ ```bash
6161 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
6262 ```
6363
64644. 安装rpcx代码生成工具(使用场景:使用[RPCX](https://rpcx.io/)组件开发mesh微服务)
6565
66- ```shell
66+ ```bash
6767 go install github.com/rpcxio/protoc-gen-rpcx@latest
6868 ```
6969
70705. 安装gorm dao代码生成工具(使用场景:使用[GORM](https://gorm.io/)作为数据库orm)
7171
72- ```shell
72+ ```bash
7373 go install github.com/dobyte/gorm-dao-generator@latest
7474 ```
7575
76766. 安装mongo dao代码生成工具(使用场景:使用[MongoDB](https://github.com/mongodb/mongo-go-driver)作为数据库orm)
7777
78- ```shell
78+ ```bash
7979 go install github.com/dobyte/mongo-dao-generator@latest
8080 ```
Original file line number Diff line number Diff line change 1111
1212在 [ due] ( https://github.com/dobyte/due ) 框架中,网关服(gate)采用模块化的架构思路,开发者可以根据自身的业务情况任意搭配模块化组件。
1313
14- ## 3.1.2 TCP网关
14+ ## 3.1.2 TCP网关示例
1515
1616以下完整示例详见:[ gate-tcp-example] ( https://github.com/dobyte/due-docs/tree/master/examples/gate-tcp-example )
1717
18181 . 创建项目
1919
20- ``` shell
20+ ``` bash
2121$ mkdir gate-tcp-example
2222```
2323
24242 . 安装依赖
2525
26- ``` shell
26+ ``` bash
2727$ cd gate-tcp-example
2828$ go mod init gate-tcp-example
2929$ go get github.com/dobyte/due/v2@v2.4.1
@@ -200,7 +200,7 @@ func main() {
200200
2012014 . 启动服务
202202
203- ``` shell
203+ ``` bash
204204$ cd gate-tcp-example
205205$ go run main.go
206206 ____ __ ________
@@ -227,19 +227,19 @@ $ go run main.go
227227└──────────────────────────────────────────────────────┘
228228```
229229
230- ## 3.1.2 WS网关
230+ ## 3.1.2 WS网关示例
231231
232232以下完整示例详见:[ gate-ws-example] ( https://github.com/dobyte/due-docs/tree/master/examples/gate-ws-example )
233233
2342341 . 创建项目
235235
236- ``` shell
236+ ``` bash
237237$ mkdir gate-ws-example
238238```
239239
2402402 . 安装依赖
241241
242- ``` shell
242+ ``` bash
243243$ cd gate-ws-example
244244$ go mod init gate-ws-example
245245$ go get github.com/dobyte/due/v2@v2.4.1
@@ -422,7 +422,7 @@ func main() {
422422
4234235 . 启动服务
424424
425- ``` shell
425+ ``` bash
426426$ cd gate-ws-example
427427$ go run main.go
428428 ____ __ ________
Original file line number Diff line number Diff line change 2424
25251 . 创建项目
2626
27- ``` shell
27+ ``` bash
2828$ mkdir node-example
2929```
3030
31312 . 安装依赖
3232
33- ``` shell
33+ ``` bash
3434$ cd node-example
3535$ go mod init node-example
3636$ go get github.com/dobyte/due/v2@v2.4.1
Original file line number Diff line number Diff line change 1212
13131 . 创建项目
1414
15- ``` shell
15+ ``` bash
1616$ mkdir mesh-grpc-example
1717```
1818
19192 . 安装依赖
2020
21- ``` shell
21+ ``` bash
2222$ cd mesh-grpc-example
2323$ go mod init mesh-grpc-example
2424$ go get github.com/dobyte/due/v2@v2.4.1
@@ -386,13 +386,13 @@ INFO[2025/10/18 13:43:48.538785] E:/workspace/dobyte/due-docs/examples/mesh-grpc
386386
3873871 . 创建项目
388388
389- ``` shell
389+ ``` bash
390390$ mkdir mesh-rpcx-example
391391```
392392
3933932 . 安装依赖
394394
395- ``` shell
395+ ``` bash
396396$ cd mesh-rpcx-example
397397$ go mod init mesh-rpcx-example
398398$ go get github.com/dobyte/due/v2@v2.4.1
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ $ go install github.com/swaggo/swag/cmd/swag@latest
2828
29291 . 创建项目
3030
31- ``` shell
31+ ``` bash
3232$ mkdir web-example
3333```
3434
35352 . 安装依赖
3636
37- ``` shell
37+ ``` bash
3838$ cd web-example
3939$ go mod init web-example
4040$ go get github.com/dobyte/due/v2@v2.4.1
You can’t perform that action at this time.
0 commit comments