{"id":16718610,"url":"https://github.com/codfrm/cago","last_synced_at":"2025-03-21T21:30:36.325Z","repository":{"id":41532167,"uuid":"510080941","full_name":"CodFrm/cago","owner":"CodFrm","description":"cago 一个快速开发的集成式框架","archived":false,"fork":false,"pushed_at":"2025-03-13T15:04:41.000Z","size":1195,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T16:22:56.297Z","etag":null,"topics":["framework","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodFrm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-03T16:46:11.000Z","updated_at":"2025-03-13T15:04:45.000Z","dependencies_parsed_at":"2023-02-17T03:01:12.370Z","dependency_job_id":"8a071c65-a7a8-453c-aff0-9357845f3e1f","html_url":"https://github.com/CodFrm/cago","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodFrm%2Fcago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodFrm%2Fcago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodFrm%2Fcago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodFrm%2Fcago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodFrm","download_url":"https://codeload.github.com/CodFrm/cago/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874093,"owners_count":20524572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","go"],"created_at":"2024-10-12T21:37:45.146Z","updated_at":"2025-03-21T21:30:35.910Z","avatar_url":"https://github.com/CodFrm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cago\n\n[![godoc](https://godoc.org/github.com/codfrm/cago?status.svg)](https://pkg.go.dev/github.com/codfrm/cago)\n[![Go Report Card](https://goreportcard.com/badge/github.com/codfrm/cago)](https://goreportcard.com/report/github.com/codfrm/cago)\n[![License](https://img.shields.io/github/license/go-eagle/eagle?style=flat-square)](/LICENSE)\n\nCago 一个快速开发的集成式框架.使用模块化的开发模式,每一个组件都可以单独的调用.\n\nCago 只对社区工具进行集成,大大减少迁移难度和学习成本,我们不生产代码,我们只是方案的搬运工.\n\n使用 go 的`struct`来声明 API 和 swagger 文档,可以通过脚手架来帮助你生成相关内容.\n\n## 快速开始\n\n你可以通过简单示例来快速的了解 Cago 的使用。你也可以复制这个示例来创建你的项目。\n\n[简单示例](./examples/simple)\n\n## 脚手架\n\n你可以安装脚手架来帮助你生成代码。\n\n[脚手架文档](./cmd/cago)\n\n## CI/CD\n\n[部署资源](./deploy)\n\ncago 提供了[`gitlab-ci`](deploy/gitlab/.gitlab-ci.yml)、[`golanglint-ci`](./deploy/.golangci.yml)和\n[`Kubernetes helm`](./deploy)的 CI/CD 配置文件,可以快速帮你实现 CI/CD.\n\n当本地调试时也可以使用[`docker-compose.yaml`](./deploy/docker-compose.yaml)启动调试环境.\n\n可以使用`etcd`作为配置中心，也支持文件作为配置启动。\n\n## 组件\n\n大多数组件都是基于社区工具进行封装，方便使用。\n\n- [常用组件包](./pkg/component)\n- [数据库组件包](./database)\n- [服务组件包](./server)\n- [中间件](./middleware)\n- [工具包/杂项](./pkg)\n\n## 目录结构\n\nCago使用三层架构，并混合了DDD的思想，推荐使用下面的目录结构。你也可以根据自己的需求来调整目录结构。\n\n- `cmd/app/main.go` 项目的入口\n- `configs`\n  - `config.yaml` 配置文件\n  - `...` 其他配置文件，也可以写配置读取方法，其它包调用：`configs.GetConfig().XXX`\n- `docs` 文档目录，包括 swagger api 文档、设计文档等\n- `deploy` 部署资源文件\n- `internal` 内部包\n  - `api` API 请求结构体\n    - `example/example.go` api请求与返回结构\n    - `router.go` 路由定义\n  - `controller` 控制器目录，API请求会调用控制器，做一些数据处理校验逻辑\n  - `model` 数据模型\n    - `entity` 数据库实体模型，推荐使用充血模型\n    - `xxx.go` 一些数据模型的定义\n  - `pkg` 项目内通用的模块\n    - `code` 错误码定义\n    - `utils` 工具包\n  - `repository` 数据库操作\n  - `service` 服务接口\n  - `task` 任务模块\n    - `crontab` 定时任务\n    - `queue` 消息队列\n      - `handler` 消息队列处理器\n      - `message` 消息定义\n      - `xxx.go` 消息队列定义\n    - `task.go` 任务定义\n- `migrations` 数据库迁移文件\n- `pkg` 公共的模块，可以被其它项目引用\n- `.golangci.yml` golangci-lint 配置文件\n- `Makefile` 项目的 Makefile 文件\n\n## 参考项目\n\n- GoFrame\n- GoMicro\n\n## Who use Cago？\n\n- [脚本猫](https://github.com/scriptscat/scriptlist)\n- [DSP2B](https://github.com/dsp2b/dsp2b)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfrm%2Fcago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodfrm%2Fcago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodfrm%2Fcago/lists"}