Files
ginframework/README.md
T
zhangdeman 52205b42c8
Verify / verify (push) Canceled after 0s
Verify / verify (pull_request) Canceled after 0s
chore(module): 更新仓库地址及模块导入路径
2026-11-27 22:58:26 -08:00

59 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ginframework
围绕 Gin、GORM/MySQL、Zap、go-redis 和原生 HTTP Client 的独立 Go 基础库。统一请求处理、配置、诊断和资源生命周期,业务认证、审计和供应商策略由消费应用负责。
- 源码:[git.zhangdeman.cn/zhangdeman/ginframework](https://git.zhangdeman.cn/zhangdeman/ginframework)
- Module:`git.zhangdeman.cn/zhangdeman/ginframework`
- 工具链:Go 1.27.0;当前尚未发布版本 tag。
## 接入使用
**[接入使用指南](docs/getting-started.md)** 是统一能力清单和使用入口,覆盖安装、最小服务、参数绑定、认证适配、日志、MySQL、Redis、出站 HTTP、SSE 和退出顺序。新增、移除及改变能力须同步该指南,公开包清单纳入 make verify。
```sh
go get git.zhangdeman.cn/zhangdeman/ginframework@codex/initial-framework
```
检出本仓库后运行最小 HTTP 示例:
```sh
go run ./examples/minimal
```
请求 `http://127.0.0.1:8080/example/ping?name=world`。不需要启动 MySQL 或 Redis。消费项目的分支版本会被 Go 解析为固定伪版本,后续升级选择已审核提交或已发布 tag。
完整资源装配、健康检查和退出示例:
```sh
go run ./examples/application -config examples/application/config.yml
```
普通 Controller 默认有 30 秒合作式预算;校验错误提供安全字段提示。健康检查需由应用显式注册并在依赖就绪后置为 ready,详见接入指南。
OpenAPI 契约可直接从 Controller 签名、字段 tag 与显式安全方案生成,不需要启动服务:
```sh
go run ./examples/openapi -out /tmp/ginframework-openapi.json
```
请求/响应 Schema、校验约束、安全声明和原生路由补充方式见接入指南 5.3。安全声明不代替认证中间件,文档端点和 UI 由应用显式发布。
## 开发与验证
先读取 [AGENTS.md](AGENTS.md) 和 [工程技术规约](docs/standards/technical-specification.md)。
```sh
make verify
make race-check
```
完整门禁包含接入文档能力清单及链接、格式、架构依赖、vet、build、test 和 Staticcheck v0.8.1。Redis 集成测试需要 redis-server,SQLite 回归需要 CGO/C 编译器。文档门禁不替代能力行为的人工语义审查。
## 迁移与边界
- [迁移清单](docs/migration.md):已有实现对应关系、兼容差异和后续回接。
- [整合与优化分析](docs/integration-optimization-review.md):HTTP Client 整合及优化依据。
- [工程规约索引](docs/standards/README.md):维护入口与实际命令。
当前尚未替换 model_dispatch 的运行依赖。真实 MySQL、业务审计、供应商及部署代理需要消费项目集成验证,不能由本地测试代替。