Skip to content

Commit 528d073

Browse files
committed
update
1 parent 5baf610 commit 528d073

File tree

1 file changed

+26
-91
lines changed
  • mono-repo/go-kratos/{{cookiecutter.repo_name}}

1 file changed

+26
-91
lines changed

mono-repo/go-kratos/{{cookiecutter.repo_name}}/README.MD

Lines changed: 26 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,70 @@
1-
21
# {{cookiecutter.repo_name}}:
32

43
> {{cookiecutter.project_short_description}}
54
6-
## cookiecutter-go:
5+
## Cookiecutter-Go:
76

87
- https://github.com/better-go/cookiecutter-go
98
- 项目目录生成脚手架, 详细使用参考文档
109

11-
## 服务列表:
12-
13-
- [x] [队列 MQ Proxy](app/basic/queue/readme.md): `app/basic/queue`
14-
- HTTP POST 方式: 异步发送消息到 rabbitmq
15-
16-
17-
## 准备工作:
18-
19-
### 启动 RabbitMQ 容器:
20-
21-
- `deploy/local/Makefile`
22-
- 启动 docker 容器
23-
24-
```bash
25-
26-
cd deploy/local
27-
28-
# 启动 docker 容器:
29-
make run.mq.rabbitmq
30-
31-
32-
```
33-
34-
- 本地 web UI 查看: http://localhost:15672/#/queues
35-
- 队列情况
36-
37-
### 启动 queue 服务:
38-
39-
- `app/basic/queue`
10+
## Go-Kratos 定制功能:
4011

12+
- [go kratos 中间件](https://go-kratos.dev/docs/category/%E4%B8%AD%E9%97%B4%E4%BB%B6)
4113

42-
```bash
14+
> 集成功能:
4315
44-
# 安装项目依赖包:
45-
make go.mod.tidy
16+
- [ ] 参数校验
17+
- [ ] 日志集成
18+
- [ ] tracing 集成: OpenTelemetry, jaeger
19+
- [x] 服务发现/注册: consul
20+
- [ ] grpc
21+
- [ ] server: 限流器
22+
- [ ] client: 熔断器
23+
- [ ] 监控: prometheus
4624

47-
# 切换到服务目录下:
48-
cd app/basic/queue
4925

50-
# 启动服务
51-
make run.auto.reload
52-
53-
54-
```
26+
## Requirements:
5527

28+
> 语言 & 框架:
5629
30+
- go 1.15+
31+
- Web Framework: go-kratos
32+
- RPC: gRPC
5733

58-
## Requirements:
34+
> 依赖中间件:
5935
60-
- go 1.15+
61-
- go-zero
62-
- gRPC
63-
- mysql
64-
- redis
65-
- kafka
66-
- docker + docker-compose
36+
- 数据库: mysql
37+
- 缓存: redis
38+
- 消息队列: kafka
39+
- 服务注册/发现: consul
40+
- Tracing: jaeger
41+
- 日志平台: ELK (Elasticsearch, Logstash, Kibana)
42+
- 部署: docker + docker-compose
6743

6844
## QuickStart:
6945

70-
- https://www.yuque.com/tal-tech/go-zero/yaoehb
71-
46+
- https://go-kratos.dev/docs/component/middleware/overview
7247

7348
### Development Environment:
7449

7550
- install:
7651

7752
```
7853
79-
# clone repo:
80-
git clone
81-
82-
# enter project root:
83-
cd .
84-
85-
# install require pkg:
86-
make go.mod.tidy
8754
8855
```
8956

90-
9157
- run 示例服务: `app/basic/demo`
9258

9359
```
94-
cd ./app/basic/demo
95-
96-
# 启动 API 服务:
97-
make run.demo
98-
99-
# 或者使用: 基于 air, watch 该服务目录, 修改后, 自动 hot reload, 无需重新编译
100-
make run.auto.reload
101-
102-
103-
# http echo test:
104-
make curl.api
105-
106-
107-
#
108-
# will print:
109-
#
110-
-> % make curl.api
111-
curl -i http://localhost:8888/from/you
112-
HTTP/1.1 200 OK
113-
Content-Type: application/json
114-
Date: Thu, 18 Feb 2021 10:48:23 GMT
115-
Content-Length: 25
116-
117-
{"message":"hello world"}%
11860
11961
12062
```
12163

122-
12364
## Structure:
12465

12566
- 目录结构简略说明: 对整体目录的 quick look.
12667

127-
12868
```html
12969

13070

@@ -152,7 +92,6 @@ Content-Length: 25
15292

15393
```
15494

155-
15695
- 代码调用链路说明: 以 `app/basic/demo` 服务为例(自顶向下调用)
15796
- Cmd 启动入口: `app/basic/demo/cmd/main.go`
15897
- Service 入口: `app/basic/demo/internal/service/service.go`
@@ -175,8 +114,6 @@ Content-Length: 25
175114

176115
- 目录结构详细说明:
177116

178-
179-
180117
```html
181118

182119

@@ -262,10 +199,8 @@ Content-Length: 25
262199

263200
```
264201

265-
266202
## Reference:
267203

268-
269204
- https://github.com/macrozheng/mall
270205
- https://zeromicro.github.io/go-zero/rpc-dir.html
271206
- rest: https://www.yuque.com/tal-tech/go-zero/bqdcb3

0 commit comments

Comments
 (0)