update doc

This commit is contained in:
kevin
2020-10-17 19:25:30 +08:00
parent e81358e7fa
commit ea7e410145
2 changed files with 13 additions and 13 deletions

View File

@@ -163,8 +163,8 @@ go get -u github.com/tal-tech/go-zero
the generated code can be run directly: the generated code can be run directly:
```shell ```shell
cd greet cd greet
go run greet.go -f etc/greet-api.yaml go run greet.go -f etc/greet-api.yaml
``` ```
by default, its listening on port 8888, while it can be changed in configuration file. by default, its listening on port 8888, while it can be changed in configuration file.

View File

@@ -44,7 +44,7 @@ go-zero 包含极简的 API 定义和生成工具 goctl可以根据定义的
对于微服务框架的设计,我们期望保障微服务稳定性的同时,也要特别注重研发效率。所以设计之初,我们就有如下一些准则: 对于微服务框架的设计,我们期望保障微服务稳定性的同时,也要特别注重研发效率。所以设计之初,我们就有如下一些准则:
* 保持简单 * 保持简单,第一原则
* 弹性设计,面向故障编程 * 弹性设计,面向故障编程
* 工具大于约定和文档 * 工具大于约定和文档
* 高可用 * 高可用
@@ -53,7 +53,7 @@ go-zero 包含极简的 API 定义和生成工具 goctl可以根据定义的
* 对业务开发友好,封装复杂度 * 对业务开发友好,封装复杂度
* 约束做一件事只有一种方式 * 约束做一件事只有一种方式
我们经历不到半年时间,彻底完成了从`Java+MongoDB``Golang+MySQL`为主的微服务体系迁移并于18年8月底完全上线稳定保障了晓黑板后续增长,确保了整个服务的高可用。 我们经历不到半年时间,彻底完成了从`Java+MongoDB``Golang+MySQL`为主的微服务体系迁移并于18年8月底完全上线稳定保障了业务后续迅速增长,确保了整个服务的高可用。
## 3. go-zero项目实现和特点 ## 3. go-zero项目实现和特点
@@ -71,7 +71,7 @@ go-zero是一个集成了各种工程实践的包含web和rpc框架有如下
* 超时级联控制 * 超时级联控制
* 自动缓存控制 * 自动缓存控制
* 链路跟踪、统计报警等 * 链路跟踪、统计报警等
* 高并发支撑,稳定保障了晓黑板疫情期间每天的流量洪峰 * 高并发支撑,稳定保障了疫情期间每天的流量洪峰
如下图,我们从多个层面保障了整体服务的高可用: 如下图,我们从多个层面保障了整体服务的高可用:
@@ -82,7 +82,7 @@ go-zero是一个集成了各种工程实践的包含web和rpc框架有如下
在项目目录下通过如下命令安装: 在项目目录下通过如下命令安装:
```shell ```shell
go get -u github.com/tal-tech/go-zero GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero
``` ```
## 5. Quick Start ## 5. Quick Start
@@ -106,23 +106,23 @@ go get -u github.com/tal-tech/go-zero
2. 快速生成api服务 2. 快速生成api服务
```shell ```shell
goctl api new greet goctl api new greet
cd greet cd greet
go run greet.go -f etc/greet-api.yaml go run greet.go -f etc/greet-api.yaml
``` ```
默认侦听在8888端口可以在配置文件里修改可以通过curl请求 默认侦听在8888端口可以在配置文件里修改可以通过curl请求
```shell ```shell
curl -i http://localhost:8888/greet/from/you curl -i http://localhost:8888/greet/from/you
``` ```
返回如下: 返回如下:
```http ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Date: Sun, 30 Aug 2020 15:32:35 GMT Date: Sun, 30 Aug 2020 15:32:35 GMT
Content-Length: 0 Content-Length: 0
``` ```
编写业务代码: 编写业务代码: