{"id":26457119,"url":"https://github.com/layasugar/laya-template","last_synced_at":"2025-03-18T22:42:18.149Z","repository":{"id":57622673,"uuid":"291968075","full_name":"layasugar/laya-template","owner":"layasugar","description":"http框架模板, grpc框架模板, task服务模板，快速搭建中小型应用服务","archived":false,"fork":false,"pushed_at":"2024-07-15T06:20:26.000Z","size":677,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-15T22:25:52.928Z","etag":null,"topics":["laya","template-project"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/layasugar.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":"2020-09-01T10:33:04.000Z","updated_at":"2024-08-22T08:34:03.000Z","dependencies_parsed_at":"2024-05-08T12:42:03.972Z","dependency_job_id":"c8c866b9-e3fe-4df4-8e46-d585cf422735","html_url":"https://github.com/layasugar/laya-template","commit_stats":null,"previous_names":["layasugar/laya-go"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layasugar%2Flaya-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layasugar%2Flaya-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layasugar%2Flaya-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layasugar%2Flaya-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/layasugar","download_url":"https://codeload.github.com/layasugar/laya-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244320326,"owners_count":20434092,"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":["laya","template-project"],"created_at":"2025-03-18T22:42:17.547Z","updated_at":"2025-03-18T22:42:18.142Z","avatar_url":"https://github.com/layasugar.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# laya-template\n\n- http框架模板, grpc框架模板, task服务模板\n- 快速搭建中小型应用服务, restfulApi, grpc服务，web服务\n\n\u003e Please note that this repository is out-of-the-box template\n\n## 使用之前\n\n- 这不是一个框架，是个人为简单编码整理的项目（服务）目录结构和代码结构\n- 适合中小型项目和应用程序\n- 不支持swagger，接口文档需要编码人员精心编写，代码保持干净整洁\n- 配置文件不支持热重载，更新配置文件需要重启服务，或者自己实现\n- 简单，快速，高效\n\n## 约定\n\n- func返回单独结构体时, 返回该数据的指针\n- core.Context需要全局传递(ctx里面内置了记录日志与链路追踪)\n- models/page 业务逻辑\n- models/data 实现数据查询组装, 查询在此处完成, 尽量不要使用join(减轻数据库压力), 数据取出后, 可在该层完成组装\n- models/dao 基本的请求层, 模型放置层\n- 非必要无须grpc连接池\n\n## 使用\n```shell\ngit clone git@github.com:layasugar/laya-template.git\n\ncd laya-template \u0026\u0026 go mod tidy\n\ngo run .\n```\n\n## 感谢以下开源仓库\n- [gin](https://github.com/gin-gonic/gin)\n- [gorm文档](https://gorm.io/zh_CN/docs/index.html)\n- [go-redis](https://redis.uptrace.dev/)\n- [mongo文档](https://www.mongodb.com/docs/drivers/go/current/usage-examples/)\n- [es文档](https://olivere.github.io/elastic/)\n\n### License\n\n`laya-template` is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.\n\n### 🔑 JetBrains OS licenses\n\n`laya-template` had been being developed with `GoLand` IDE under the **free JetBrains Open Source license(s)** granted by JetBrains s.r.o., hence I would like to express my thanks here.\n\n\u003ca href=\"https://www.jetbrains.com/?from=gnet\" target=\"_blank\"\u003e\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png\" width=\"250\" align=\"middle\"/\u003e\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayasugar%2Flaya-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayasugar%2Flaya-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayasugar%2Flaya-template/lists"}