# GoCommon 供其他 Go 项目引用的通用工具库。对接请看:**[INTEGRATION.md](./INTEGRATION.md)** ``` git.toowon.com/jimmy/go-common ``` ```bash go env -w GOPRIVATE=git.toowon.com go get git.toowon.com/jimmy/go-common@v1.4.0 ``` ## 设计 - **Factory**:启动初始化一次,getter 取模块对象 - **模块包**:`object.Method()`(如 `log.Info`、`store.Upload`) - **http**:统一出参(`Handler`) - **tools / migration**:无状态或独立 CLI,不经 Factory 透传 ## 模块 | 包 | 说明 | |----|------| | `config` | JSON 配置 | | `factory` | 入口与 lazy getter | | `http` | 请求解析、统一响应 | | `middleware` | CORS、日志、Recovery、限流、语种、时区 | | `logger` | 异步日志 | | `storage` | Local / OSS / MinIO | | `email` / `sms` | SMTP、阿里云短信 | | `excel` | 导出 | | `i18n` | 多语言消息 | | `migration` | SQL 迁移 | | `tools` | 时间、加密、金额等 | | `mcp` | MCP Client(多 server、`ListTools`/`CallTool`) | | `captcha` | 图形验证码、登录防暴力(可选,`enabled` 开关) | ## 文档 | 文档 | 说明 | |------|------| | [INTEGRATION.md](./INTEGRATION.md) | 对接手册 | | [VERSION.md](./VERSION.md) | 版本与发布 | | [templates/](./templates/) | server / migrate 等脚手架 | | [config/example.json](./config/example.json) | 配置示例 | | [examples/](./examples/) | 示例代码 |