{"id":20766192,"url":"https://github.com/navono/grpc-http-rest","last_synced_at":"2026-04-24T10:04:55.725Z","repository":{"id":74496765,"uuid":"163047077","full_name":"navono/grpc-http-rest","owner":"navono","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-02T12:20:42.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T22:31:03.147Z","etag":null,"topics":["client-grpc","grpc","grpc-gateway"],"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/navono.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}},"created_at":"2018-12-25T04:52:56.000Z","updated_at":"2019-07-02T12:20:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"fabd4237-8e1b-4172-8290-66f49c5a3489","html_url":"https://github.com/navono/grpc-http-rest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/navono/grpc-http-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fgrpc-http-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fgrpc-http-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fgrpc-http-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fgrpc-http-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navono","download_url":"https://codeload.github.com/navono/grpc-http-rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fgrpc-http-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32218293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T09:47:08.147Z","status":"ssl_error","status_checked_at":"2026-04-24T09:46:41.165Z","response_time":64,"last_error":"SSL_read: 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":["client-grpc","grpc","grpc-gateway"],"created_at":"2024-11-17T11:21:55.840Z","updated_at":"2026-04-24T10:04:55.689Z","avatar_url":"https://github.com/navono.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dev\n\n## 基本\n\n- 下载 [protobuf](https://github.com/protocolbuffers/protobuf/releases) 编译工具，将 `bin` 加入到环境变量\n- 下载安装 `golang` 版本的插件\n  \u003e go get -u -v github.com/golang/protobuf/protoc-gen-go\n- 编译\n  \u003e protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 todo-service.proto\n- 数据库依赖于运行在 `Docker` 中的 `MySQL`，启动 `MySQL` 容器：\n  \u003e ./third_party/db.cmd\n\n  如果数据库客户端（navicat）链接不上：\n  \u003e docker exec -it todo-mysql bash\n  \u003e\n  \u003e mysql -u root -p\n  \u003e\n  \u003e ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';\n  \u003e\n  \u003e ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';\n  \u003e\n  \u003e FLUSH PRIVILEGES;\n\n## grpc-gateway\n\n安装依赖：\n\u003e go get -u -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway\n\u003e\n\u003e go get -u -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger\n\n找到 `grpc-gateway` 的安装目录，我这是在\n\n```sh\n%GOPATH%\\pkg\\mod\\github.com\\grpc-ecosystem\\grpc-gateway@v1.6.2\\third_party\\googleapis\\google\n```\n\n将安装目录下的 `protoc-gen-swagger/options` 下的 proto 文件拷贝到工程目录下的 `third_party\\protoc-gen-swagger\\options`。\n\n# 测试\n\n编译时可能需要科学上网。\n\n## grpc\n\n### 服务器端\n\n- 手动编译\n  \u003e cd cmd/server\n  \u003e\n  \u003e go build .\n\n  运行：\n  \u003e .\\server.exe -grpc-port=9090 -http-port=8080 -db-host=localhost:3306 -db-user=root -db-password=123456 -db-schema=todo -log-level=-1 -log-time-format=2006-01-02T15:04:05.999999999Z07:00\n\n- 容器\n  \u003c/br\u003e\n  构建镜像：\n  \u003e .\\scripts\\buildImage.cmd\n\n  启动：\n  \u003e .\\scripts\\start.cmd\n\n  停止：\n  \u003e .\\scripts\\clean.cmd\n\n### rpc客户端\n\n编译：\n\u003e cd cmd/client-grpc\n\u003e\n\u003e go build .\n\n运行：\n\u003e .\\client-grpc.exe -server=localhost:9090\n\n### rest客户端\n\n编译：\n\u003e cd cmd/client-rest\n\u003e\n\u003e go build .\n\n运行：\n\u003e .\\client-rest.exe -server=http://localhost:8080\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavono%2Fgrpc-http-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavono%2Fgrpc-http-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavono%2Fgrpc-http-rest/lists"}