{"id":20734372,"url":"https://github.com/byebyebruce/pbdynamic","last_synced_at":"2025-08-23T06:36:15.109Z","repository":{"id":83558185,"uuid":"543464584","full_name":"byebyebruce/pbdynamic","owner":"byebyebruce","description":"通过读取protobuf的file descriptor(protoc --descriptor_set_out)构造动态类型","archived":false,"fork":false,"pushed_at":"2022-09-30T07:02:16.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-16T12:08:32.732Z","etag":null,"topics":["descriptor","dynamic","dynamicpb","proto","protobuf","protoc"],"latest_commit_sha":null,"homepage":"","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/byebyebruce.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":"2022-09-30T06:44:34.000Z","updated_at":"2023-05-14T06:13:20.000Z","dependencies_parsed_at":"2023-07-07T19:16:16.221Z","dependency_job_id":null,"html_url":"https://github.com/byebyebruce/pbdynamic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/byebyebruce/pbdynamic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byebyebruce%2Fpbdynamic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byebyebruce%2Fpbdynamic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byebyebruce%2Fpbdynamic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byebyebruce%2Fpbdynamic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byebyebruce","download_url":"https://codeload.github.com/byebyebruce/pbdynamic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byebyebruce%2Fpbdynamic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745679,"owners_count":24813521,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["descriptor","dynamic","dynamicpb","proto","protobuf","protoc"],"created_at":"2024-11-17T05:30:10.063Z","updated_at":"2025-08-23T06:36:15.059Z","avatar_url":"https://github.com/byebyebruce.png","language":"Go","readme":"# pbdynamic\n动态解析 protobuf 类型\n\n## 原理解释  \n通过加载pb 描述符文件(protoc --descriptor_set_out=xxx.pb.desc xxx.proto)，不需要重新编译xxx.pb.go的情况下动态的构造pb类型，  \n进而反序列化字节，并打印信息\n\n## 快速使用\n1. 生成filedesc文件\n* [示例](testdata/gen.sh)\n```shell\nprotoc --descriptor_set_out=xxx.pb.desc xxx.proto\n```\n2. 依赖包\n```shell\ngo get github.com/byebyebruce/pbdynamic@latest\n```\n\n3. 解析从字节动态反序列化pb并打印\n```go\nerr := pbdynamic.LoadFiles(\"xxx.pb.desc\")\nif err != nil {\n    panic(err)\n}\n\n// bs 是从其他地方来的pb序列化后的字节\nfmt.Println(pbdynamic.String(bs, \"mypkg.SomeTypeName\"))\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyebyebruce%2Fpbdynamic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyebyebruce%2Fpbdynamic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyebyebruce%2Fpbdynamic/lists"}