https://github.com/api7/go-template
golang 系列的模板项目,约定目录结构 以及 基本组件
https://github.com/api7/go-template
Last synced: 10 months ago
JSON representation
golang 系列的模板项目,约定目录结构 以及 基本组件
- Host: GitHub
- URL: https://github.com/api7/go-template
- Owner: api7
- Created: 2020-11-09T08:29:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-08T02:59:52.000Z (about 5 years ago)
- Last Synced: 2023-07-05T05:31:44.626Z (over 2 years ago)
- Size: 1.95 KB
- Stars: 5
- Watchers: 5
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-template
golang 工程的模板项目,约定目录结构 以及 基本组件
## 目录结构
| directory | 描述 |
| --- | --- |
| pkg | 可以被外部项目依赖 |
| internal | 本项目的私有代码,不可以被外部项目依赖,编译时会校验 |
| api | 对外接口定的义,比如 http request / response struct 或者 grpc 的 proto 文件 |
| cmd | 项目入口函数所在目录,如果有多个入口,通过子目录区分 比如 /api/books/main.go |
| docs | 项目文档所在路径 |
| test | 存放一些公共的测试工具方法和依赖,工具分为 e2e 或者 其他集成测试,也包含启动特定测试的脚本 |
| conf | 存放一些默认配置,只包含配置文件 |