Skip to content

Commit

Permalink
Refactor go-zero link
Browse files Browse the repository at this point in the history
  • Loading branch information
anqiansong authored and kesonan committed Oct 17, 2021
1 parent 19e981f commit c740697
Show file tree
Hide file tree
Showing 47 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion doc/shorturl-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To build a well working microservice, we need lots of knowledges from different
3. logging, collects data and helps to backtrace problems
4. observability, no metrics, no optimization

For any point listed above, we need a long article to describe the theory and the implementation. But for us, the developers, it’s very difficult to understand all the concepts and make it happen in our systems. Although, we can use the frameworks that have been well served busy sites. [go-zero](https://github.com/tal-tech/go-zero) is born for this purpose, especially for cloud-native microservice systems.
For any point listed above, we need a long article to describe the theory and the implementation. But for us, the developers, it’s very difficult to understand all the concepts and make it happen in our systems. Although, we can use the frameworks that have been well served busy sites. [go-zero](https://github.com/zeromicro/go-zero) is born for this purpose, especially for cloud-native microservice systems.

As well, we always adhere to the idea that **prefer tools over conventions and documents**. We hope to reduce the boilerplate code as much as possible, and let developers focus on developing the business related code. For this purpose, we developed the tool `goctl`.

Expand Down
2 changes: 1 addition & 1 deletion doc/shorturl.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
3. 日志,用于数据收集和问题定位
4. 可观测性,没有度量就没有优化

对于其中每一点,我们都需要用很长的篇幅来讲述其原理和实现,那么对我们后端开发者来说,要想把这些知识点都掌握并落实到业务系统里,难度是非常大的,不过我们可以依赖已经被大流量验证过的框架体系。[go-zero 微服务框架](https://github.com/tal-tech/go-zero)就是为此而生。
对于其中每一点,我们都需要用很长的篇幅来讲述其原理和实现,那么对我们后端开发者来说,要想把这些知识点都掌握并落实到业务系统里,难度是非常大的,不过我们可以依赖已经被大流量验证过的框架体系。[go-zero 微服务框架](https://github.com/zeromicro/go-zero)就是为此而生。

另外,我们始终秉承 **工具大于约定和文档** 的理念。我们希望尽可能减少开发人员的心智负担,把精力都投入到产生业务价值的代码上,减少重复代码的编写,所以我们开发了 `goctl` 工具。

Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
link: "/zero/",
},
{
text: "go-zero",link: "https://github.com/tal-tech/go-zero",
text: "go-zero",link: "https://github.com/zeromicro/go-zero",
},
{
text: "CDS",link: "https://github.com/tal-tech/cds",
Expand Down
4 changes: 2 additions & 2 deletions docs/zero/bookstore-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ To build a well working microservice, we need lots of knowledges from different
3. logging, collects data and helps to backtrace problems
4. observability, no metrics, no optimization

For any point listed above, we need a long article to describe the theory and the implementation. But for us, the developers, it’s very difficult to understand all the concepts and make it happen in our systems. Although, we can use the frameworks that have been well served busy sites. [go-zero](https://github.com/tal-tech/go-zero) is born for this purpose, especially for cloud-native microservice systems.
For any point listed above, we need a long article to describe the theory and the implementation. But for us, the developers, it’s very difficult to understand all the concepts and make it happen in our systems. Although, we can use the frameworks that have been well served busy sites. [go-zero](https://github.com/zeromicro/go-zero) is born for this purpose, especially for cloud-native microservice systems.

As well, we always adhere to the idea that **prefer tools over conventions and documents**. We hope to reduce the boilerplate code as much as possible, and let developers focus on developing the business related code. For this purpose, we developed the tool `goctl`.

Let’s take the shorturl microservice as a quick example to demonstrate how to quickly create microservices by using [go-zero](https://github.com/tal-tech/go-zero). After finishing this tutorial, you’ll find that it’s so easy to write microservices!
Let’s take the shorturl microservice as a quick example to demonstrate how to quickly create microservices by using [go-zero](https://github.com/zeromicro/go-zero). After finishing this tutorial, you’ll find that it’s so easy to write microservices!

## 1. What is a bookstore service

Expand Down
4 changes: 2 additions & 2 deletions docs/zero/bookstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
3. 日志,用于数据收集和问题定位
4. 可观测性,没有度量就没有优化

对于其中每一点,我们都需要用很长的篇幅来讲述其原理和实现,那么对我们后端开发者来说,要想把这些知识点都掌握并落实到业务系统里,难度是非常大的,不过我们可以依赖已经被大流量验证过的框架体系。[go-zero微服务框架](https://github.com/tal-tech/go-zero)就是为此而生。
对于其中每一点,我们都需要用很长的篇幅来讲述其原理和实现,那么对我们后端开发者来说,要想把这些知识点都掌握并落实到业务系统里,难度是非常大的,不过我们可以依赖已经被大流量验证过的框架体系。[go-zero微服务框架](https://github.com/zeromicro/go-zero)就是为此而生。

另外,我们始终秉承**工具大于约定和文档**的理念。我们希望尽可能减少开发人员的心智负担,把精力都投入到产生业务价值的代码上,减少重复代码的编写,所以我们开发了`goctl`工具。

下面我通过书店服务来演示通过[go-zero](https://github.com/tal-tech/go-zero)快速的创建微服务的流程,走完一遍,你就会发现:原来编写微服务如此简单!
下面我通过书店服务来演示通过[go-zero](https://github.com/zeromicro/go-zero)快速的创建微服务的流程,走完一遍,你就会发现:原来编写微服务如此简单!

## 1. 书店服务示例简介

Expand Down
2 changes: 1 addition & 1 deletion docs/zero/periodlimit.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ end

## 参考

- [go-zero periodlimit](https://github.com/tal-tech/go-zero/blob/master/core/limit/periodlimit.go)
- [go-zero periodlimit](https://github.com/zeromicro/go-zero/blob/master/core/limit/periodlimit.go)
- [分布式服务限流实战,已经为你排好坑了](https://www.infoq.cn/article/Qg2tX8fyw5Vt-f3HH673)

<Vssue title="periodLimit" />
2 changes: 1 addition & 1 deletion docs/zero/附录1.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ info(
**语法定义**


> 由于其和golang相似,因此不做详细说明,具体语法定义请在[ApiParser.g4](https://github.com/tal-tech/go-zero/blob/master/tools/goctl/api/parser/g4/ApiParser.g4)中查看typeSpec定义。
> 由于其和golang相似,因此不做详细说明,具体语法定义请在[ApiParser.g4](https://github.com/zeromicro/go-zero/blob/master/tools/goctl/api/parser/g4/ApiParser.g4)中查看typeSpec定义。


Expand Down
4 changes: 2 additions & 2 deletions go-zero.dev/cn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# go-zero

[![Go](https://github.com/zeromicro/go-zero/workflows/Go/badge.svg?branch=master)](https://github.com/tal-tech/go-zero/actions)
[![Go](https://github.com/zeromicro/go-zero/workflows/Go/badge.svg?branch=master)](https://github.com/zeromicro/go-zero/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/tal-tech/go-zero)](https://goreportcard.com/report/github.com/tal-tech/go-zero)
[![goproxy](https://goproxy.cn/stats/github.com/tal-tech/go-zero/badges/download-count.svg)](https://goproxy.cn/stats/github.com/tal-tech/go-zero/badges/download-count.svg)
[![codecov](https://codecov.io/gh/tal-tech/go-zero/branch/master/graph/badge.svg)](https://codecov.io/gh/tal-tech/go-zero)
[![Release](https://img.shields.io/github/v/release/tal-tech/go-zero.svg?style=flat-square)](https://github.com/tal-tech/go-zero)
[![Release](https://img.shields.io/github/v/release/tal-tech/go-zero.svg?style=flat-square)](https://github.com/zeromicro/go-zero)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## 0. go-zero 介绍
Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/api-grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ info(
**语法定义**

由于其和golang相似,因此不做详细说明,具体语法定义请在 [ApiParser.g4](https://github.com/tal-tech/go-zero/blob/master/tools/goctl/api/parser/g4/ApiParser.g4) 中查看typeSpec定义。
由于其和golang相似,因此不做详细说明,具体语法定义请在 [ApiParser.g4](https://github.com/zeromicro/go-zero/blob/master/tools/goctl/api/parser/g4/ApiParser.g4) 中查看typeSpec定义。

**语法说明**

Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/breaker-algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

### 熔断器引入

上面介绍了熔断器的原理,在了解完原理后,你是否有思考我们如何引入熔断器呢?一种方案是在业务逻辑中可以加入熔断器,但显然是不够优雅也不够通用的,因此我们需要把熔断器集成在框架内,在[zRPC](https://github.com/tal-tech/go-zero/tree/master/zrpc)框架内就内置了熔断器
上面介绍了熔断器的原理,在了解完原理后,你是否有思考我们如何引入熔断器呢?一种方案是在业务逻辑中可以加入熔断器,但显然是不够优雅也不够通用的,因此我们需要把熔断器集成在框架内,在[zRPC](https://github.com/zeromicro/go-zero/tree/master/zrpc)框架内就内置了熔断器

我们知道,熔断器主要是用来保护调用端,调用端在发起请求的时候需要先经过熔断器,而客户端拦截器正好兼具了这个这个功能,所以在zRPC框架内熔断器是实现在客户端拦截器内,拦截器的原理如下图:

Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/buiness-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func ListByRangeTime(r redis.Redis, start, end time.Time) ([]*Content, error) {
或者说不会再访问了,面对这种场景,如果我又该如何考虑缓存的设计呢?在go-zero内容实践中,有两种方案可以解决这种问题:

* 增加内存缓存:通过内存缓存来存储当前可能突发访问量比较大的数据,常用的存储方案采用map数据结构来存储,map数据存储实现比较简单,但缓存过期处理则需要增加
定时器来出来,另一宗方案是通过go-zero库中的 [Cache](https://github.com/tal-tech/go-zero/blob/master/core/collection/cache.go) ,其是专门
定时器来出来,另一宗方案是通过go-zero库中的 [Cache](https://github.com/zeromicro/go-zero/blob/master/core/collection/cache.go) ,其是专门
用于内存管理.
* 采用biz redis,并设置合理的过期时间

Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (pe *PeriodicalExecutor) Wait() {
> [!TIP]
> `go test` 存在竞态,使用加锁来避免这种情况
- 在分析 `confirmChan` 时发现,`confirmChan` 在此次[提交](https://github.com/tal-tech/go-zero/commit/9d9399ad1014c171cc9bd9c87f78b5d2ac238ce4)才出现,为什么会这么设计?
- 在分析 `confirmChan` 时发现,`confirmChan` 在此次[提交](https://github.com/zeromicro/go-zero/commit/9d9399ad1014c171cc9bd9c87f78b5d2ac238ce4)才出现,为什么会这么设计?

> 之前是:`wg.Add(1)` 是写在 `executeTasks()` ;现在是:先`wg.Add(1)`,再放开 `confirmChan` 阻塞
> 如果 `executor func` 执行阻塞,`Add task` 还在进行,因为没有阻塞,可能很快执行到 `Executor.Wait()`,这时就会出现 `wg.Wait()``wg.Add()` 前执行,这会 `panic`
Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/fx.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 流处理工具fx

[gozero](https://github.com/tal-tech/go-zero)是一个功能完备的微服务框架,框架中内置了很多非常实用的工具,其中就包含流数据处理工具[fx](https://github.com/tal-tech/go-zero/tree/master/core/fx),下面我们通过一个简单的例子来认识下该工具:
[gozero](https://github.com/zeromicro/go-zero)是一个功能完备的微服务框架,框架中内置了很多非常实用的工具,其中就包含流数据处理工具[fx](https://github.com/zeromicro/go-zero/tree/master/core/fx),下面我们通过一个简单的例子来认识下该工具:

```go
package main
Expand Down
4 changes: 2 additions & 2 deletions go-zero.dev/cn/goctl-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ USAGE:
OPTIONS:
--dir value the target dir
--api value the api file
--style value the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]
--style value the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]
```

* --dir 代码输出目录
* --api 指定api源文件
* --style 指定生成代码文件的文件名称风格,详情见[文件名称命名style说明](https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md)
* --style 指定生成代码文件的文件名称风格,详情见[文件名称命名style说明](https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md)

## 使用示例
```shell
Expand Down
4 changes: 2 additions & 2 deletions go-zero.dev/cn/goctl-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ OPTIONS:
OPTIONS:
--src value, -s value the path or path globbing patterns of the ddl
--dir value, -d value the target dir
--style value the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]
--style value the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]
--cache, -c generate code with cache [optional]
--idea for idea plugin [optional]
```
Expand All @@ -284,7 +284,7 @@ OPTIONS:
--table value, -t value the table or table globbing patterns in the database
--cache, -c generate code with cache [optional]
--dir value, -d value the target dir
--style value the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]
--style value the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]
--idea for idea plugin [optional]
```
Expand Down
4 changes: 2 additions & 2 deletions go-zero.dev/cn/goctl-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ OPTIONS:
--src value, -s value the file path of the proto source file
--proto_path value, -I value native command of protoc, specify the directory in which to search for imports. [optional]
--dir value, -d value the target path of the code
--style value the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]
--style value the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]
--idea whether the command execution environment is from idea plugin. [optional]
```
Expand All @@ -146,7 +146,7 @@ OPTIONS:
* --src 必填,proto数据源,目前暂时支持单个proto文件生成
* --proto_path 可选,protoc原生子命令,用于指定proto import从何处查找,可指定多个路径,如`goctl rpc -I={path1} -I={path2} ...`,在没有import时可不填。当前proto路径不用指定,已经内置,`-I`的详细用法请参考`protoc -h`
* --dir 可选,默认为proto文件所在目录,生成代码的目标目录
* --style 可选,输出目录的文件命名风格,详情见https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md
* --style 可选,输出目录的文件命名风格,详情见https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md
* --idea 可选,是否为idea插件中执行,终端执行可以忽略
Expand Down
2 changes: 1 addition & 1 deletion go-zero.dev/cn/intellij.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Go-Zero Plugin

[<img src="https://img.shields.io/badge/Github-go--zero-brightgreen?logo=github" alt="go-zero"/>](https://github.com/tal-tech/go-zero)
[<img src="https://img.shields.io/badge/Github-go--zero-brightgreen?logo=github" alt="go-zero"/>](https://github.com/zeromicro/go-zero)
[<img src="https://img.shields.io/badge/License-MIT-blue" alt="license"/>](https://github.com/zeromicro/goctl-intellij/blob/main/LICENSE)
[<img src="https://img.shields.io/badge/Release-0.7.14-red" alt="release"/>](https://github.com/zeromicro/goctl-intellij/releases)
[<img src="https://github.com/zeromicro/goctl-intellij/workflows/Java%20CI%20with%20Gradle/badge.svg" alt="Java CI with Gradle" />](https://github.com/zeromicro/goctl-intellij/actions)
Expand Down
12 changes: 6 additions & 6 deletions go-zero.dev/cn/join-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## 概要
<img src="./resource/go-zero-logo.png" alt="go-zero" width="100px" height="100px" align="right" />

[go-zero](https://github.com/tal-tech/go-zero) 是一个基于[MIT License](https://github.com/tal-tech/go-zero/blob/master/LICENSE) 的开源项目,大家在使用中发现bug,有新的特性等,均可以参与到go-zero的贡献中来,我们非常欢迎大家的积极参与,也会最快响应大家提出的各种问题,pr等。
[go-zero](https://github.com/zeromicro/go-zero) 是一个基于[MIT License](https://github.com/zeromicro/go-zero/blob/master/LICENSE) 的开源项目,大家在使用中发现bug,有新的特性等,均可以参与到go-zero的贡献中来,我们非常欢迎大家的积极参与,也会最快响应大家提出的各种问题,pr等。

## 贡献形式
* [Pull Request](https://github.com/tal-tech/go-zero/pulls)
* [Issue](https://github.com/tal-tech/go-zero/issues)
* [Pull Request](https://github.com/zeromicro/go-zero/pulls)
* [Issue](https://github.com/zeromicro/go-zero/issues)

## 贡献须知
go-zero 的Pull request中的代码需要满足一定规范
Expand All @@ -17,7 +17,7 @@ go-zero 的Pull request中的代码需要满足一定规范
* 增加单元测试覆盖率达80%+

## 贡献代码(pr)
* 进入[go-zero](https://github.com/tal-tech/go-zero) 项目,fork一份[go-zero](https://github.com/tal-tech/go-zero) 项目到自己的github仓库中。
* 进入[go-zero](https://github.com/zeromicro/go-zero) 项目,fork一份[go-zero](https://github.com/zeromicro/go-zero) 项目到自己的github仓库中。
* 回到自己的github主页,找到`xx/go-zero`项目,其中xx为你的用户名,如`anqiansong/go-zero`

![fork](./resource/fork.png)
Expand All @@ -34,15 +34,15 @@ go-zero 的Pull request中的代码需要满足一定规范
![pr](./resource/compare.png)

* 点击`【Create pull request】`即可实现pr申请
* 确认pr是否提交成功,进入[go-zero](https://github.com/tal-tech/go-zero)[Pull requests](https://github.com/tal-tech/go-zero/pulls) 查看,应该有自己提交的记录,名称为你的开发时的分支名称
* 确认pr是否提交成功,进入[go-zero](https://github.com/zeromicro/go-zero)[Pull requests](https://github.com/zeromicro/go-zero/pulls) 查看,应该有自己提交的记录,名称为你的开发时的分支名称

![pr record](./resource/pr_record.png)

## Issue
在我们的社区中,有很多伙伴会积极的反馈一些go-zero使用过程中遇到的问题,由于社区人数较多,我们虽然会实时的关注社区动态,但大家问题反馈过来都是随机的,当我们团队还在解决某一个伙伴提出的问题时,另外的问题也反馈上来,可能会导致团队会很容易忽略掉,为了能够一一的解决大家的问题,我们强烈建议大家通过issue的方式来反馈问题,包括但不限于bug,期望的新功能特性等,我们在实现某一个新特性时也会在issue中体现,大家在这里也能够在这里获取到go-zero的最新动向,也欢迎大家来积极的参与讨论。

### 怎么提Issue
* 点击[这里](https://github.com/tal-tech/go-zero/issues) 进入go-zero的Issue页面或者直接访问[https://github.com/tal-tech/go-zero/issues](https://github.com/tal-tech/go-zero/issues) 地址
* 点击[这里](https://github.com/zeromicro/go-zero/issues) 进入go-zero的Issue页面或者直接访问[https://github.com/zeromicro/go-zero/issues](https://github.com/zeromicro/go-zero/issues) 地址
* 点击右上角的`【New issue】`新建issue
* 填写issue标题和内容
* 点击`【Submit new issue】`提交issue
Expand Down
Loading

0 comments on commit c740697

Please sign in to comment.