Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zhufuyi committed Jan 29, 2024
1 parent 0573c94 commit ff1a0e6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![codecov](https://codecov.io/gh/zhufuyi/sponge/branch/main/graph/badge.svg)](https://codecov.io/gh/zhufuyi/sponge)
[![Go Reference](https://pkg.go.dev/badge/github.com/zhufuyi/sponge.svg)](https://pkg.go.dev/github.com/zhufuyi/sponge)
[![Go](https://github.com/zhufuyi/sponge/workflows/Go/badge.svg?branch=main)](https://github.com/zhufuyi/sponge/actions)
[![Awesome Go](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go)
[![License: MIT](https://img.shields.io/github/license/zhufuyi/sponge)](https://img.shields.io/github/license/zhufuyi/sponge)

</div>
Expand All @@ -18,9 +19,9 @@

<br>

If you are developing a RESTful web or microservice with a simple CRUD API interface, you don't need to write a single line of golang code to compile and deploy to servers, dockers, k8s, and the complete service code is generated by sponge.
If you are developing a RESTful web service or microservice with a simple CRUD API interface, you don't need to write a single line of golang code to compile and deploy to servers, dockers, k8s, and the complete service code is generated by sponge.

If you develop a generic RESTful web or microservice, you need to manually write code in addition to defining the data table, defining the api interface in the proto file, and filling in the specific business logic code in the generated template file. Other golang codes are generated by sponge.
If you develop a generic RESTful web service or microservice, you need to manually write code in addition to defining the data table, defining the api interface in the proto file, and filling in the specific business logic code in the generated template file. Other golang codes are generated by sponge.

<br>

Expand Down Expand Up @@ -64,7 +65,7 @@ Egg model profiling diagram for `⓷Web services created based on protobuf`:
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/en_web-http-pb-anatomy.png">
</p>

This is the egg model for web service code, and there are egg models for microservice (grpc) code, and grpc gateway service code described in [sponge documentation](https://go-sponge.com/learn-about-sponge?id=%f0%9f%8f%b7project-code-egg-model).
This is the egg model for web service code, and there are egg models for grpc service code, and grpc gateway service code described in [sponge documentation](https://go-sponge.com/learn-about-sponge?id=%f0%9f%8f%b7project-code-egg-model).

<br>

Expand Down
Binary file modified assets/en_sponge-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions assets/install-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@

下载go地址: [https://studygolang.com/dl](https://studygolang.com/dl)

> 要求1.16以上版本
> 建议是1.20以上版本
查看go版本 `go version`

<br>

**✅ 安装 protoc**

下载protoc地址: [https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3](https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3)
下载protoc地址: [https://github.com/protocolbuffers/protobuf/releases/tag/v25.2](https://github.com/protocolbuffers/protobuf/releases/tag/v25.2)

> 要求v3.20以上版本,把 protoc 二进制文件所在目录添加到系统环境变量path
> 要求v3.20以上版本,根据系统类型下载对应的 protoc 二进制文件,把 protoc 二进制文件移动到go二进制文件所在的目录
查看protoc版本: `protoc --version`

<br>

安装完go和protoc之后,接下来安装sponge,支持在windows、mac、linux环境安装。

> 如果不能科学上网,安装sponge时,获取github的库会遇到超时失败问题,建议设置为国内代理,执行命令 **go env -w GOPROXY=https://goproxy.cn,direct**
> 如果不能科学上网,安装sponge时,获取github的库可能会遇到超时失败问题,建议设置为国内代理,执行命令 **go env -w GOPROXY=https://goproxy.cn,direct**
<br>

Expand Down Expand Up @@ -192,10 +192,10 @@ services:
- "24631:24631"
```
启动服务:
```bash
# 启动服务
docker-compose up -d

```

在docker部署成功后,在浏览器访问 `http://你的宿主机ip:24631`
6 changes: 3 additions & 3 deletions assets/install-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

Download go from: [https://go.dev/doc/install](https://go.dev/doc/install)

> Required version: 1.16 or above.
> Recommended version: 1.20 or above.
Check go version: `go version`

<br>

**✅ Installing protoc**

Download protoc from: [https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3](https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3)
Download protoc from: [https://github.com/protocolbuffers/protobuf/releases/tag/v25.2](https://github.com/protocolbuffers/protobuf/releases/tag/v25.2)

> Required version: v3.20 or above. add the directory where the protoc binaries are located to the system environment variable path.
> Required version: v3.20 or above. Download the protoc binaries according to the system type, move the protoc binaries to the directory where the go binaries are located.
Check protoc version: `protoc --version`

Expand Down
4 changes: 2 additions & 2 deletions assets/readme-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sponge生成代码过程中剥离了业务逻辑与非业务逻辑两大部分
<img width="1200px" src="https://raw.githubusercontent.com/zhufuyi/sponge_examples/main/assets/web-http-pb-anatomy.png">
</p>

这是web服务代码鸡蛋模型,还有微服务(grpc)代码、grpc网关服务代码的鸡蛋模型在[sponge文档](https://go-sponge.com/zh-cn/learn-about-sponge?id=%f0%9f%8f%b7%e9%a1%b9%e7%9b%ae%e4%bb%a3%e7%a0%81%e9%b8%a1%e8%9b%8b%e6%a8%a1%e5%9e%8b)中有介绍。
这是web服务代码鸡蛋模型,还有grpc服务代码、grpc网关服务代码的鸡蛋模型在[sponge文档](https://go-sponge.com/zh-cn/learn-about-sponge?id=%f0%9f%8f%b7%e9%a1%b9%e7%9b%ae%e4%bb%a3%e7%a0%81%e9%b8%a1%e8%9b%8b%e6%a8%a1%e5%9e%8b)中有介绍。

<br>

Expand All @@ -69,7 +69,7 @@ sponge包含丰富的组件(按需使用):
- 自动化api接口文档 [swagger](https://github.com/swaggo/swag), [protoc-gen-openapiv2](https://github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2)
- 鉴权 [jwt](https://github.com/golang-jwt/jwt)
- 校验 [validator](https://github.com/go-playground/validator)
- 消息组件 [rabbitmq](github.com/rabbitmq/amqp091-go)
- 消息组件 [rabbitmq](https://github.com/rabbitmq/amqp091-go)
- 分布式事务管理器 [dtm](https://github.com/dtm-labs/dtm)
- 自适应限流 [ratelimit](https://github.com/zhufuyi/sponge/tree/main/pkg/shield/ratelimit)
- 自适应熔断 [circuitbreaker](https://github.com/zhufuyi/sponge/tree/main/pkg/shield/circuitbreaker)
Expand Down
Binary file modified assets/sponge-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion cmd/sponge/scripts/build-sponge-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

TAG=$1
if [ "X${TAG}" = "X" ];then
echo "image tag cannot be empty, example: ./image-build.sh v1.5.8"
echo "image tag cannot be empty, example: ./build-sponge-image.sh v1.5.8"
exit 1
fi

Expand Down

0 comments on commit ff1a0e6

Please sign in to comment.