{"id":20767212,"url":"https://github.com/cyhhao/gin-frame","last_synced_at":"2025-04-30T10:45:27.217Z","repository":{"id":41039976,"uuid":"166352979","full_name":"cyhhao/gin-frame","owner":"cyhhao","description":"一个基于 gin 的脚手架（A Gin-based Scaffold）","archived":false,"fork":false,"pushed_at":"2019-03-18T09:59:18.000Z","size":10297,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-21T01:42:27.811Z","etag":null,"topics":["example","gin","scaffold"],"latest_commit_sha":null,"homepage":null,"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/cyhhao.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}},"created_at":"2019-01-18T06:05:49.000Z","updated_at":"2024-03-21T01:42:27.813Z","dependencies_parsed_at":"2022-09-20T20:58:31.480Z","dependency_job_id":null,"html_url":"https://github.com/cyhhao/gin-frame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyhhao%2Fgin-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyhhao%2Fgin-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyhhao%2Fgin-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyhhao%2Fgin-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyhhao","download_url":"https://codeload.github.com/cyhhao/gin-frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225030910,"owners_count":17409967,"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":["example","gin","scaffold"],"created_at":"2024-11-17T11:28:14.441Z","updated_at":"2024-11-17T11:28:14.919Z","avatar_url":"https://github.com/cyhhao.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 简介\ngin 脚手架，集成了以下依赖\n\n-  [go-ini/ini](https://github.com/go-ini/ini)  \n    读取 ini 配置文件，用于不同环境的参数配置，支持从环境变量读取配置\n    \n-  [sirupsen/logrus](https://github.com/sirupsen/logrus)  \n    打印 log，支持各种格式、颜色的 log 打印\n    \n-  [jinzhu/gorm](https://github.com/jinzhu/gorm)    \n    著名 ORM\n    \n以上几个依赖都是各自功能类别里 star 数最多的优秀类库\n\n使用 [dep](https://github.com/golang/dep) 管理依赖\n\n# 启动\n```shell\n# 开发环境\ngo run main.go --env dev\n# 测试环境\ngo run main.go --env test\n# 生产环境\ngo run main.go --env prod\n```\n\n# 配置文件\n`conf/` 目录下默认有三个环境的配置文件：\n\n- app.ini 为通用配置，所有环境继承此配置文件\n- dev.ini 相同的配置会覆盖 app.ini 中的配置，对应 --env dev \n- test.ini 对应 --env test\n- prod.ini 对应 --env prod\n- 新建 xxx.ini ，需修改 `utils/config.go` 内相关代码即可\n\n配置文件中使用 `${xxx}` 可从环境变量中读取参数\n\n如：\n```\n# prod.ini\n[mysql]\npassword = ${MYSQL_PASSWORD}\n\n# shell\nexport MYSQL_PASSWORD=password\n``` \n\n# 代码热更新\n代码变更，自动热更新重启。推荐使用 [github.com/cosmtrek/air]([https://github.com/cosmtrek/air)\n\n`.air.conf`文件是一份默认配置，若已安装 air ，直接在路径下运行 `air` 即可\n\n\n# 更多模块\n- with-swagger分支：集成了 swagger，可以便捷地生成 API doc\n- with-jwt分支：集成了 jwt 中间件，解析header中的userToken获取用户身份ID\n\n如需同时使用多个模块，可用 git merge 进行组合","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyhhao%2Fgin-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyhhao%2Fgin-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyhhao%2Fgin-frame/lists"}