{"id":38094905,"url":"https://github.com/prf16/go-zero-box-rpc","last_synced_at":"2026-01-22T18:53:24.739Z","repository":{"id":332312164,"uuid":"1133360202","full_name":"prf16/go-zero-box-rpc","owner":"prf16","description":"📦开箱即用的go-zero rpc 示例，内置 rpc、scheduler、queue、script 服务。","archived":false,"fork":false,"pushed_at":"2026-01-13T10:50:46.000Z","size":11720,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T11:44:27.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Smarty","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/prf16.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T08:39:21.000Z","updated_at":"2026-01-13T10:50:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prf16/go-zero-box-rpc","commit_stats":null,"previous_names":["prf16/go-zero-box-rpc"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/prf16/go-zero-box-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prf16%2Fgo-zero-box-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prf16%2Fgo-zero-box-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prf16%2Fgo-zero-box-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prf16%2Fgo-zero-box-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prf16","download_url":"https://codeload.github.com/prf16/go-zero-box-rpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prf16%2Fgo-zero-box-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"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":[],"created_at":"2026-01-16T21:00:28.297Z","updated_at":"2026-01-22T18:53:24.730Z","avatar_url":"https://github.com/prf16.png","language":"Smarty","funding_links":[],"categories":["Libraries that use [go-zero](https://github.com/tal-tech/go-zero)"],"sub_categories":[],"readme":"## 概述\n\n### 简介\n\ngo-zero-box-rpc 是 go-zero-box 体系中专门面向 rpc 服务 的工程模板方案。\n\n它基于 go-zero 官方 rpc 能力（gRPC + zrpc），在此之上进一步沉淀了实战中验证过的 rpc 工程结构\n\n同样 go-zero-box 拥有的能力依然在 rpc 服务内置了，比如 scheduler、queue、script 服务。\n\n如果你正在使用 go-zero 构建 多服务架构，并希望 rpc 服务：\n\n - 结构清晰\n\n - 职责单一\n\n - 易于维护和扩展\n\n那么 go-zero-box-rpc 将非常适合你。\n\n好了，准备好开始了吗！\n\n### 代码结构\n\n```text\n.\n├── app                             包含应用程序的主要代码\n│   ├── rpc                         rpc 描述文件\n│   ├── etc                         静态配置文件目录\n│   ├── internal                    内部业务逻辑\n│   ├── app.go                      应用程序的入口文件，定义了 rpc、scheduler、queue、script 服务。\n│   ├── wire.go                     依赖注入文件\n│   └── wire_gin.go                 依赖注入生成文件\n├── build                           项目构建目录\n│   ├── app                         应用构建后的目录  \n│   │   ├── api                     接口文档目录     \n│   │   ├── etc                     配置文件目录\n│   │   └── app                     应用二进制文件\n│   └── app.tar                     应用构建后的打包文件\n├── deploy                          部署相关目录\n│   ├── access                      示例图片                       \n│   ├── goctl                       模板文件\n│   └── sql                         初始化数据库SQL\n├── pkg                             工具包\n├── runtime                         项目运行时目录\n├── vendor                          项目依赖包\n├── .gitignore                      git 忽略文件\n├── go.mod                          项目依赖管理文件\n├── Makefile                        项目构建文件\n└── README.md                       项目说明文件\n```\n\n## 安装开发工具\n\n### wire\n\nwire 是一个依赖注入工具，用于解决 Go 语言中依赖注入的问题。通过 wire，您可以轻松地管理应用程序的依赖关系，并确保它们在编译时进行注入。\n\n```shell\n# shell 安装\n$ go install github.com/google/wire/cmd/wire@latest\n\n# 验证安装\n$ wire\n```\n\n### goctl 安装\n\ngoctl 是 go-zero 微服务框架下的代码生成工具。使用 goctl 可显著提升开发效率，让开发人员将时间重点放在业务开发上，其功能有：api服务生成、rpc服务生成、model代码生成、模板管理。\n\n```shell\n# 方式一（推荐）：shell 安装\n$ go install github.com/zeromicro/go-zero/tools/goctl@v1.9.2\n\n# 方式二：手动下载安装\nhttps://github.com/zeromicro/go-zero/releases/tag/tools%2Fgoctl%2Fv1.9.2\n\n# 验证安装\n$ goctl --version\n```\n\n## Make 命令介绍\n\nMakefile 文件描述了 Linux 系统下项目工程的编译规则，只需要一个 `make bild` 命令，整个工程就开始自动构建项目环境，不再需要手动执行大量的 `go build` 命令，Makefile 文件定义了一系列规则，指明了源文件的编译顺序、依赖关系、是否需要重新编译等，可以输入 `make help` 查看命令集。\n\n```shell\n# 查看 make 信息\n$ make\n\n# 构建并打包应用（根据 env=dev|test|prod 编译，生成 build/app 及 app.tar）\n$ make build\n\n# 根据 app.proto 定义生成 Go RPC 代码\n$ make rpc\n\n# 根据 wire.go 生成依赖注入代码（wire_gen.go）\n$ make wire\n\n# 根据 MySQL 表结构生成 Go Model 代码\n$ make model\n```\n\n## 快速开始示例\n参考 [go-zero-box 快速开始示例](https://github.com/prf16/go-zero-box?tab=readme-ov-file#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B%E7%A4%BA%E4%BE%8B)\n\n## 常见问题\n### 1. go mod tidy 超时 i/o timeout\n```\n1. 确认当前shell\necho $SHELL\n\n2. 编辑相应的 Shell 配置文件\na. 如果使用 zsh\nvim ~/.zshrc\n\na. 如果使用 bash\nvim ~/.bash_profile\n\n3. 添加配置信息\nexport GOPROXY=https://proxy.golang.org,https://mirrors.aliyun.com/goproxy/,direct\n\n4. 重载配置\nsource ~/.zshrc\nsource ~/.bash_profile\n\n5. 查看更新结果\ngo env GOPROXY\n```\n\n## 许可证\n\n本项目采用 Apache License 2.0 许可证 - 查看 LICENSE 文件了解详情","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprf16%2Fgo-zero-box-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprf16%2Fgo-zero-box-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprf16%2Fgo-zero-box-rpc/lists"}