2
2
# cookiecutter-go
3
3
4
4
- boilerplate, go project starter.
5
- - go 微服务项目目录生成工具.
6
- - feature:
7
- - [x] ` mono repo ` : 支持创建 ` mono repo ` , git 项目根目录.
8
- - [ x] [ go-zero] ( https://github.com/tal-tech/go-zero )
9
- - [ x] [ gin] ( https://github.com/gin-gonic/gin )
10
- - [ x] [ go-micro] ( https://github.com/asim/go-micro )
11
- - [x] ` single app ` : 支持创建 ` single app ` , 单个微服务目录.
12
- - [x] [ go-zero] ( https://github.com/tal-tech/go-zero )
13
- - [x] [ gin] ( https://github.com/gin-gonic/gin )
14
- - [x] [ go-micro] ( https://github.com/asim/go-micro )
15
- - [x] 可单个使用, 也可同时组合使用
5
+ - [x] go 微服务(` go-zero/gin/go-micro ` )项目目录生成工具/脚手架.
6
+ - [x] 基于 [ cookiecutter] ( https://github.com/cookiecutter/cookiecutter ) 实现.
7
+
8
+
9
+
10
+ ## Feature:
11
+
12
+
13
+ - [x] ` mono repo ` : 支持创建 ` mono repo ` , git 项目根目录.
14
+ - [x] [ go-zero] ( https://github.com/tal-tech/go-zero )
15
+ - [x] [ gin] ( https://github.com/gin-gonic/gin )
16
+ - [x] [ go-micro] ( https://github.com/asim/go-micro )
17
+ - [x] ` single app ` : 支持创建 ` single app ` , 单个微服务目录.
18
+ - [x] [ go-zero] ( https://github.com/tal-tech/go-zero )
19
+ - [x] [ gin] ( https://github.com/gin-gonic/gin )
20
+ - [x] [ go-micro] ( https://github.com/asim/go-micro )
21
+ - [x] 可单个使用, 也可同时组合使用
16
22
- usage:
17
23
- [x] 先创建 ` mono-repo ` 根目录
18
24
- [x] 切换到 ` app/ ` 下, 创建 ` single app ` 单个微服务目录.
19
- - require:
20
- - [x] 基于 [ cookiecutter] ( https://github.com/cookiecutter/cookiecutter ) 实现.
21
-
22
25
23
- ## feature :
26
+ ### Intro :
24
27
25
28
- ` go-zero ` 微服务:
26
29
- [x] 集成 air 工具, watch 项目代码, ` 自动编译 + hot reload ` , 让 go 开发更丝滑(类 Python/Js)
46
49
- [x] log: 集成 uber log
47
50
- [x] db: 集成 gorm + mysql
48
51
49
- ## 应用案例 :
52
+ ## User Case :
50
53
51
54
- [x] https://github.com/zeromicro/zeromall
52
55
- 基于 go-zero 的微服务` B2B2C电商平台 `
53
56
54
57
55
- ## quickstart :
58
+ ## Quick Start :
56
59
57
- ### install :
60
+ ### Install :
58
61
59
62
- https://cookiecutter.readthedocs.io/en/1.7.2/installation.html
60
63
@@ -68,7 +71,7 @@ sudo apt-get install cookiecutter
68
71
69
72
```
70
73
71
- ### best practice :
74
+ ### Best Practice :
72
75
73
76
74
77
- [x] choice 1: create ` mono-repo ` + ` single-app `
@@ -79,9 +82,9 @@ sudo apt-get install cookiecutter
79
82
- [x] choice 2: create ` library-repo `
80
83
81
84
82
- #### 1. mono-repo + single-app
85
+ #### 1. Mono-Repo + Single-App
83
86
84
- - 1.1 create mono repo:
87
+ - 1.1 create ` mono repo ` :
85
88
86
89
87
90
> git repo / project root.
@@ -108,7 +111,7 @@ cookiecutter https://github.com/better-go/cookiecutter-go.git --directory="mono-
108
111
```
109
112
110
113
111
- - 1.2 create single app folder:
114
+ - 1.2 create ` single app ` folder:
112
115
113
116
``` bash
114
117
@@ -146,8 +149,9 @@ cookiecutter https://github.com/better-go/cookiecutter-go.git --directory="libra
146
149
147
150
148
151
149
- ## mono repo structure :
152
+ ## Generate Project Folder Structure :
150
153
154
+ - [x] Mono Repo:
151
155
152
156
``` bash
153
157
@@ -216,7 +220,7 @@ cookiecutter https://github.com/better-go/cookiecutter-go.git --directory="libra
216
220
```
217
221
218
222
219
- ## single app structure :
223
+ - [x] single app:
220
224
221
225
222
226
``` bash
@@ -241,16 +245,29 @@ cookiecutter https://github.com/better-go/cookiecutter-go.git --directory="libra
241
245
```
242
246
243
247
244
- ## cookiecutter docs:
248
+ ## Reference:
249
+
250
+ - https://github.com/audreyr/cookiecutter-pypackage
251
+ - https://github.com/pydanny/cookiecutter-django
252
+ - https://github.com/pydanny/cookiecutter-django/blob/master/cookiecutter.json
253
+ - https://github.com/golang-standards/project-layout
254
+ - https://github.com/micro/micro
255
+ - https://github.com/micro/micro/blob/master/client/cli/new/new.go
256
+ - https://github.com/adobe/go-starter
257
+ - https://github.com/gatsbyjs/gatsby-starter-default
258
+
259
+
260
+
261
+ ### cookiecutter docs:
245
262
246
263
- https://github.com/cookiecutter/cookiecutter
247
264
- ` 项目脚手架 ` 的脚手架
248
265
249
- ### install:
266
+ > install:
250
267
251
268
- https://cookiecutter.readthedocs.io/en/1.7.2/installation.html
252
269
253
- ### multi template:
270
+ > multi template:
254
271
255
272
- https://cookiecutter.readthedocs.io/en/1.7.2/advanced/directories.html
256
273
- 支持一个 git 下, 存放多个` 目录创建模板 ` .
@@ -262,7 +279,7 @@ cookiecutter https://github.com/user/repo-name.git --directory="directory1-name"
262
279
263
280
```
264
281
265
- ### create a template:
282
+ > create a template:
266
283
267
284
268
285
- https://cookiecutter.readthedocs.io/en/1.7.2/first_steps.html
@@ -292,15 +309,3 @@ mkdir {{cookiecutter.repo_name}}
292
309
293
310
```
294
311
295
-
296
-
297
- ## ref:
298
-
299
- - https://github.com/audreyr/cookiecutter-pypackage
300
- - https://github.com/pydanny/cookiecutter-django
301
- - https://github.com/pydanny/cookiecutter-django/blob/master/cookiecutter.json
302
- - https://github.com/golang-standards/project-layout
303
- - https://github.com/micro/micro
304
- - https://github.com/micro/micro/blob/master/client/cli/new/new.go
305
- - https://github.com/adobe/go-starter
306
- - https://github.com/gatsbyjs/gatsby-starter-default
0 commit comments