-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c437422
commit d83ec61
Showing
14 changed files
with
208 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"label": "指南", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 0.9 | ||
--- | ||
|
||
# 配置 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 控制器 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# 异常处理 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
# 日志 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# 中间件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 3.1 | ||
--- | ||
|
||
# 模型 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# 路由 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# 服务 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
sidebar_position: 4 | ||
--- | ||
|
||
# 部署 | ||
# 正式部署 | ||
|
||
多种方式部署你的项目 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
sidebar_position: 0.1 | ||
--- | ||
|
||
# 目录结构 | ||
|
||
展示当前项目的目录结构,各部分的作用。 | ||
|
||
项目目录结构完全遵守 [project-layout](https://github.com/golang-standards/project-layout) 规范,结构清晰,便于扩展和维护。 | ||
|
||
> `project-layout`: | ||
> 这是 Go 应用程序项目的基本布局。它不是核心 Go 开发团队定义的官方标准;然而,它是 Go 生态系统中一组常见的老项目和新项目的布局模式。其中一些模式比其他模式更受欢迎。它还具有许多小的增强,以及对任何足够大的实际应用程序通用的几个支持目录。 | ||
```sh | ||
|
||
. | ||
├── .github ---------------------------- GitHub 相关配置 | ||
│ └── workflows ------------------------ GitHub Actions 配置 | ||
│ ├── deploy.yml --------------------- 部署到github pages | ||
│ └── go.yml ------------------------- Go | ||
├── api -------------------------------- API 文档 | ||
│ └── swagger -------------------------- swagger 接口文档 | ||
│ ├── docs.go | ||
│ ├── swagger.json | ||
│ └── swagger.yaml | ||
├── assets ----------------------------- 静态资源 | ||
│ ├── golang.png | ||
│ └── x.png | ||
├── build ------------------------------ 构建目录 | ||
├── cmd -------------------------------- 命令行工具 | ||
│ ├── root.go -------------------------- 命令行工具入口 | ||
│ ├── server.go ------------------------ 服务命令 | ||
│ └── version.go ----------------------- 版本命令 | ||
├── configs ---------------------------- 配置文件 | ||
│ ├── config.example.yaml -------------- 配置文件示例 | ||
│ ├── config.go ------------------------ 配置文件解析 | ||
│ ├── jwt.go --------------------------- JWT 配置 | ||
│ ├── mongo.go ------------------------- MongoDB 配置 | ||
│ ├── mysql.go ------------------------- MySQL 配置 | ||
│ ├── redis.go ------------------------- Redis 配置 | ||
│ └── server.go ------------------------ 项目服务配置 | ||
├── deployments ------------------------ 部署相关 | ||
│ ├── docker-compose.yml --------------- Docker Compose 配置 | ||
│ └── restart-server.sh ---------------- 重启服务脚本 | ||
├── docs ------------------------------- 文档 | ||
├── githooks --------------------------- Git 钩子 | ||
│ ├── commit-msg ----------------------- Git 提交信息钩子 | ||
│ └── pre-commit ----------------------- Git 提交前钩子 | ||
├── internal --------------------------- 内部代码 | ||
│ ├── controllers ---------------------- 控制器 | ||
│ │ ├── example.go --------------------- 示例控制器 | ||
│ │ ├── public.go ---------------------- 公共控制器 | ||
│ │ └── user.go ------------------------ 用户控制器 | ||
│ ├── middlewares -------------------- 中间件 | ||
│ │ ├── cors.go ---------------------- 跨域中间件 | ||
│ │ ├── errorHandle.go --------------- 错误处理中间件 | ||
│ │ ├── jwt.go ----------------------- JWT 中间件 | ||
│ │ ├── limit.go --------------------- 限流中间件 | ||
│ │ └── middleware.go ---------------- 中间件入口 | ||
│ ├── models ------------------------- 模型 | ||
│ │ ├── example.go ------------------- 示例模型 | ||
│ │ ├── model.go --------------------- 模型入口 | ||
│ │ └── user.go ---------------------- 用户模型 | ||
│ ├── pkg ---------------------------- 内部代码共享包 | ||
│ │ ├── logger ----------------------- 日志 | ||
│ │ │ ├── logger.go ------------------ 日志入口 | ||
│ │ │ ├── logrus.go ------------------ logrus 日志 | ||
│ │ │ └── zap.go ---------------------- zap 日志 | ||
│ │ ├── mongo ------------------------ MongoDB 包 | ||
│ │ │ └── mongo.go --------------------- MongoDB 包入口 | ||
│ │ ├── mysql ------------------------ MySQL 包 | ||
│ │ │ └── mysql.go --------------------- MySQL 包入口 | ||
│ │ ├── redis ------------------------ Redis 包 | ||
│ │ │ └── redis.go ------------------- Redis 包入口 | ||
│ │ ├── response --------------------- 响应包 | ||
│ │ │ └── response.go ---------------- 响应包入口 | ||
│ │ └── utils ------------------------ 工具包 | ||
│ │ └── jwt.go --------------------- jwt 工具包 | ||
│ ├── router ------------------------- 路由 | ||
│ │ ├── example.go ------------------- 示例路由 | ||
│ │ ├── public.go -------------------- 公共路由 | ||
│ │ ├── router.go -------------------- 路由入口 | ||
│ │ └── user.go ---------------------- 用户路由 | ||
│ └── services ----------------------- 服务 | ||
│ ├── example.go ------------------- 示例服务 | ||
│ ├── service.go ------------------- 服务入口 | ||
│ └── user.go ---------------------- 用户服务 | ||
├── scripts ---------------------------- 脚本 | ||
│ ├── build.sh ------------------------- 构建脚本 | ||
│ ├── clean.sh ------------------------- 清理脚本 | ||
│ └── lint.sh -------------------------- 代码检查脚本 | ||
├── test ------------------------------- 测试目录 | ||
├── .air.toml -------------------------- air 配置 | ||
├── .gitignore ------------------------- git 忽略文件 | ||
├── LICENSE ---------------------------- 开源协议 | ||
├── Makefile --------------------------- Makefile | ||
├── README.md -------------------------- 项目说明 | ||
├── README_en.md ----------------------- 项目说明(英文版) | ||
├── go.mod ----------------------------- go mod | ||
├── go.sum ----------------------------- go mod | ||
└── main.go ---------------------------- 项目入口 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters