{"id":48446228,"url":"https://github.com/goapt/grpc-http","last_synced_at":"2026-04-06T18:01:49.840Z","repository":{"id":331230190,"uuid":"1125764824","full_name":"goapt/grpc-http","owner":"goapt","description":"generate grpc google api to golang http handler","archived":false,"fork":false,"pushed_at":"2026-01-04T01:20:11.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-04T17:50:16.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goapt.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":"2025-12-31T10:11:55.000Z","updated_at":"2026-01-04T01:20:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/goapt/grpc-http","commit_stats":null,"previous_names":["goapt/grpc-http"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/goapt/grpc-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goapt%2Fgrpc-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goapt%2Fgrpc-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goapt%2Fgrpc-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goapt%2Fgrpc-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goapt","download_url":"https://codeload.github.com/goapt/grpc-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goapt%2Fgrpc-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31483380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"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":[],"created_at":"2026-04-06T18:01:49.036Z","updated_at":"2026-04-06T18:01:49.834Z","avatar_url":"https://github.com/goapt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protoc-gen-go-http\n\n从 protobuf 文件中生成使用 golang http handler\n\n\n## 安装\n\n```shell\ngo install github.com/goapt/grpc-http/cmd/protoc-gen-go-http@latest\n```\n\n## 生成\n\n```shell\nprotoc --proto_path=. \\\n--proto_path=./third_party \\\n--go-http_out=paths=source_relative:. \\\n./example.proto\n```\n\n## 合约\n你需要实现合约`[contract](contract)`中的接口\nCodec: 用户解析请求和返回数据\nServeMux: 可以使用http.ServeMux\n\n```go\nmux := http.NewServeMux()\n\napiv1.RegisterUserServiceHTTPServer(mux,codec,userService)\n\nserver := \u0026http.Server{\n    Addr:    \":8080\", \n    Handler: mux, \n}\n\nif err := server.ListenAndServe(); err != nil \u0026\u0026 err != http.ErrServerClosed {\n    fmt.Printf(\"Server startup failed: %v\\n\", err)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoapt%2Fgrpc-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoapt%2Fgrpc-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoapt%2Fgrpc-http/lists"}