module
Version:
v0.0.0-...-36f27ca
Opens a new window with list of versions in this module.
Published: Sep 22, 2021
License: MIT
Opens a new window with license information.
README
¶
监控微服务
目录结构
-
/web 前端代码存放目录
-
/cmd 子项目main函数入口文件
-
/internal 私有应用和库代码
-
/internal/pkg: 存放项目内可共享, 但项目外不公项的代码
- code: 可共享的项目业务代码
- validate: 通用验证函数
- middleware: http处理链
-
/internal/子项目名server: 存放真实应用代码
- /option 子项目 command flag
- /config 根据命令行参数创建应用配置
- /service 子项目业务逻辑
- /store 持久化逻辑
-
/internal/子项目ctl: 存放客户端应用
-
/pkg 可被外部项目共享的代码
-
/third_party: 第三方依赖库
-
/test 存放其他外部测出应用和测试数据.
- /data 或 /testdata: 存放测试数据
-
/configs 用来配置文件模板或默认配置. 注意不要放如敏感信息
-
/deploy 或 /deployments IaaS/PaaS系统和容器编排配置和模板
-
/init 存放初始化系统(systemd, upstart, sysv)和进程管理配置文件(runit, supervisord), 如systemd的unit文件.
-
Makefile
-
/scripts 存放脚本文件
- /make-rules: 存放makefile文件, 实现根Makefile文件中的各种功能.
- /lib: shell库, 存放shell脚本. 如: 发布, 更新, 生成代码等.
- /install: 项目自动化部署脚本. 如果部署简单, 也可以直接放在/scripts下
-
/build 存放安装包和CI相关文件
- /package 存放Docker. 系统包配置(deb, rpm, pkg)和脚本
- /ci 存放CI配置文件(drone, gitlab)和脚本
- /docker: 存放各个组件的Dockerfile文件
-
/tools 项目支持工具. 导入来自/pkg和/internal目录的代码
-
/githooks git钩子.
-
/assets 项目使用的其他资源, 如图片,CSS,Javascript等
-
/website 可以存放项目网站代码
-
/doc 项目设计文档, 开发文档, 用户文档
- /dev 存放开发文档
- /guide 存放用户手册, 安装, quickStart, 产品文档等
-
/api 存放项目对外提供的各种不同类型的API接口定义文件.
- /openapi
- /swagger
- README.md
- /docs
- swagger.yaml
-
/LICENSE
-
/examples 公共包的示例代码
Git提交规范
项目使用commitlint
约束提交信息规范, 提交信息必须已以下关键字开头.
build: 构建相关
ci: 持续集成相关
chore: 跟仓库主要业务无关的构建/工程依赖/工具等功能改动(比如新增一个文档生成工具)
docs: 更新了文档(比如改了 Readme)
feat: 功能改进/一个新特性
fix: 修了一个 Bug
perf: 优化了性能的代码改动
refactor: 一些代码结构上优化,既不是新特性也不是修 Bug(比如函数改个名字)
revert: 恢复先前的提交
style: 不修改src(源码)或测试文件的其他修改
test: 测试相关
举例: git commit -m 'feat: 添加mysql存储store通用包'
Directories
¶
internal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pkg/common/log/glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
|
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.