{"id":15091214,"url":"https://github.com/dev-openapi/protoc-gen-go_api","last_synced_at":"2026-02-14T04:11:25.728Z","repository":{"id":141681597,"uuid":"582517278","full_name":"dev-openapi/protoc-gen-go_api","owner":"dev-openapi","description":"根据proto文件生成go调用","archived":false,"fork":false,"pushed_at":"2023-07-20T01:45:08.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-27T10:29:43.589Z","etag":null,"topics":["client","douyin","douyin-api","kuaishou-api","open-api","protobuf","protobuf-go","protoc-gen-go","wechat","wexin"],"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/dev-openapi.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":"2022-12-27T04:45:02.000Z","updated_at":"2023-07-18T09:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"b51fc74b-4c4b-4ed3-9d95-076b588331fd","html_url":"https://github.com/dev-openapi/protoc-gen-go_api","commit_stats":null,"previous_names":["g-openapi/protoc-gen-go_api","ga-openapi/protoc-gen-go_api","open-api-go/protoc-gen-go_api","dev-openapi/protoc-gen-go_api"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-openapi%2Fprotoc-gen-go_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-openapi%2Fprotoc-gen-go_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-openapi%2Fprotoc-gen-go_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-openapi%2Fprotoc-gen-go_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-openapi","download_url":"https://codeload.github.com/dev-openapi/protoc-gen-go_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945594,"owners_count":20536295,"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":["client","douyin","douyin-api","kuaishou-api","open-api","protobuf","protobuf-go","protoc-gen-go","wechat","wexin"],"created_at":"2024-09-25T10:36:28.292Z","updated_at":"2026-01-04T23:02:03.157Z","avatar_url":"https://github.com/dev-openapi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protoc-gen-go_api\n一款用protobuf文件生成go的http调用代码。\n\n## 安装\n\n```bash\ngo install github.com/dev-openapi/protoc-gen-go_api@latest\n```\n\n## 使用\n\n依赖googleapis的http.proto和annotations.proto。并且需要放到google/api/目录下\n\n如果google/api是在工程文件目录下，执行以下脚本\n\n```bash\nprotoc --go_api_out=out={dir}:. *.proto\n```\n\n如果google/api在其他文件目录下，执行以下脚本\n\n```bash\nprotoc --proto_path={yourpath}:. --go_api_out=:. *.proto\n```\n\n## 注意\n\n最新版本的protoc-gen-go要求go_package必须含有/，且会生成到$GOPATH/src目录下，所以建议把工程文件放到$GOPATH/src/git域名/git_group/目录下。\n\n如 https://github.com/dev-openapi/wx-miniprogram 则该工程文件为 $GOPATH/src/github.com/dev-openapi/wx-miniprogram\n\n另外，也可以指定protoc-gen-go的生成目录和设置source_relative相关配置，也可以生成到指定目录\n\n如\n```shell\nprotoc --go_out=.. --go_opt=paths=source_relative --go_api_out=out=..:. *.proto\n```\n\n这样会生成到上一层目录\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-openapi%2Fprotoc-gen-go_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-openapi%2Fprotoc-gen-go_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-openapi%2Fprotoc-gen-go_api/lists"}