{"id":34216896,"url":"https://github.com/uozi-tech/cosy","last_synced_at":"2026-03-09T22:32:19.567Z","repository":{"id":257820061,"uuid":"768001914","full_name":"uozi-tech/cosy","owner":"uozi-tech","description":"a Comfortable Object-oriented Simplified framework for You","archived":false,"fork":false,"pushed_at":"2026-03-09T06:15:08.000Z","size":8472,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-09T11:26:40.085Z","etag":null,"topics":["curd","gin","go"],"latest_commit_sha":null,"homepage":"https://cosy.uozi.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uozi-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-06T09:40:07.000Z","updated_at":"2026-03-09T06:15:12.000Z","dependencies_parsed_at":"2026-01-01T01:02:53.062Z","dependency_job_id":null,"html_url":"https://github.com/uozi-tech/cosy","commit_stats":null,"previous_names":["uozi-tech/cosy"],"tags_count":173,"template":false,"template_full_name":null,"purl":"pkg:github/uozi-tech/cosy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uozi-tech%2Fcosy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uozi-tech%2Fcosy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uozi-tech%2Fcosy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uozi-tech%2Fcosy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uozi-tech","download_url":"https://codeload.github.com/uozi-tech/cosy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uozi-tech%2Fcosy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30314628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T20:05:46.299Z","status":"ssl_error","status_checked_at":"2026-03-09T19:57:04.425Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["curd","gin","go"],"created_at":"2025-12-15T22:17:59.424Z","updated_at":"2026-03-09T22:32:19.545Z","avatar_url":"https://github.com/uozi-tech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cosy - Golang Web API 框架助手\n\na **C**omfortable **O**bject-oriented **S**implified framework for **Y**ou\n\nDesigned by @0xJacky 2024-2025\n\nCosy 是一个方便的工具，基于泛型，面相对象，旨在简化基于 Gin 框架并使用 Gorm 作为 ORM 的 Web API 的创建、更新和列出数据库记录的过程。\n\n目标是简化繁琐重复的 CURD 过程，并且对 ChatGPT 友好。\n\n## 特点\n\n1. **链式方法：** 为 CRUD 操作轻松设置各种查询条件和配置\n2. **基本生命周期:** BeforeDecode, BeforeExecute, GormAction, Executed\n3. **钩子系统：** 提供在主要 CRUD 操作之前和之后执行函数的能力\n    - map 转换为 struct 前的钩子 `BeforeDecodeHook`\n    - 数据库操作执行前的钩子 `BeforeExecuteHook`\n    - 数据库执行时的钩子 `GormScope`\n    - 数据库执行后的钩子 `ExecutedHook`\n    - 钩子的设置函数可以被多次调用，将会按照调用顺序执行\n4. **接口级性能**：只涉及到泛型，Cosy 层面上没有使用 reflect\n5. **路由级性能**：几乎仅在程序初始化阶段使用 reflect，并对模型的反射结果缓存到 map 中\n6. **强大的标签系统**：通过 `cosy` 标签控制字段在不同操作中的行为\n7. **自定义筛选器**：支持自定义列表筛选器，满足复杂查询需求\n8. **批量操作**：支持批量创建、更新、删除和恢复操作\n9. **事务支持**：内置事务支持，确保数据一致性\n10. **配置文件支持**：支持 INI 和 TOML 两种配置文件格式\n11. **队列系统**：基于 Redis 的简单队列，支持生产者-消费者模式\n12. **定时任务**：集成 gocron 定时任务调度器\n13. **错误处理**：完善的错误处理机制，支持错误文档和代码生成\n14. **日志系统**：基于 zap 的高性能日志系统\n15. **热重载**：支持 HTTPS 证书热重载\n\n## 数据库驱动支持\n\n- [MySQL](https://github.com/uozi-tech/cosy-driver-mysql)\n- [Postgres](https://github.com/uozi-tech/cosy-driver-postgres)\n- [Sqlite](https://github.com/uozi-tech/cosy-driver-sqlite)\n\n## 文档\nhttps://cosy.uozi.org/\n\n## 在项目中使用\n```shell\ngo get -u github.com/uozi-tech/cosy\n```\n\n## 版权\nCopyright © 2024-2025 UoziTech\n\nCosy 版权属于柚子星云科技（深圳）有限公司，并已取得软件著作权。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuozi-tech%2Fcosy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuozi-tech%2Fcosy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuozi-tech%2Fcosy/lists"}