{"id":20954432,"url":"https://github.com/devsisters/go-dyncapnp","last_synced_at":"2025-09-03T06:39:13.874Z","repository":{"id":144213087,"uuid":"271004496","full_name":"devsisters/go-dyncapnp","owner":"devsisters","description":"Dynamic Cap'n'proto parsing \u0026 generating in Go","archived":false,"fork":false,"pushed_at":"2023-04-27T07:57:03.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-03T06:39:10.974Z","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/devsisters.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":"2020-06-09T13:04:30.000Z","updated_at":"2023-04-27T07:48:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3734c51-70b4-4d6a-915a-e8cf9922fd9b","html_url":"https://github.com/devsisters/go-dyncapnp","commit_stats":null,"previous_names":["wkbae/go-dyncapnp"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/devsisters/go-dyncapnp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsisters%2Fgo-dyncapnp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsisters%2Fgo-dyncapnp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsisters%2Fgo-dyncapnp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsisters%2Fgo-dyncapnp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsisters","download_url":"https://codeload.github.com/devsisters/go-dyncapnp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsisters%2Fgo-dyncapnp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273403948,"owners_count":25099299,"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-09-03T02:00:09.631Z","response_time":76,"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":[],"created_at":"2024-11-19T01:14:40.720Z","updated_at":"2025-09-03T06:39:13.839Z","avatar_url":"https://github.com/devsisters.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-dyncapnp\n\ngo-dyncapnp is a Go library that provides a wrapper around the original capnproto C++ library with CGO. It is designed to parse .capnp schema files on-the-go, without requiring re-compilation. This makes it easier to work with capnproto schemas in Go projects, especially when the schema is being actively developed and updated.\n\n## Features\n\n- Written in Go, with CGO bindings to the original Cap'n Proto C++ library\n- Parses .capnp schema files on-the-go, without re-compilation\n- Capable of encoding/decoding packed/plain Cap'n Proto format binary based on the schema\n- Catches C++ exceptions and emits them in Go style\n\n## Installation\n\nTo use go-dyncapnp in your project, you can simply run:\n\n```\ngo get github.com/devsisters/go-dyncapnp\n```\n\n## Usage\n\nTo use go-dyncapnp, you need to provide a map of files containing capnproto schema definitions, along with any necessary imports and the paths to the schema files. You can then call the `ParseFromFiles` function to parse the schemas and obtain a map of `ParsedSchema` objects.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/devsisters/go-dyncapnp\"\n)\n\nfunc main() {\n\tschemaFiles := map[string][]byte{\n\t\t\"user.capnp\": []byte(`\n            @0xe4b3f8bd92dc065d;\n\n            struct User {\n                id    @0 :UInt64;\n                name  @1 :Text;\n                email @2 :Text;\n            }\n        `),\n\t}\n\n\tschemaImports := map[string][]byte{}\n\n\tschemaPaths := []string{\"user.capnp\"}\n\n\tschemas, err := dyncapnp.ParseFromFiles(schemaFiles, schemaImports, schemaPaths)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tuserFile := schemas[\"user.capnp\"]\n\tuserSchema, err := userFile.Nested(\"User\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(userSchema.ShortDisplayName())\n\tfor _, field := range userSchema.AsStruct().Fields() {\n\t\tp, err := field.Proto()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Printf(\" %s @%d %s\\n\", p.Name(), field.Index(), field.Type().Which())\n\t}\n\t// User\n\t//  id @0 uint64\n\t//  name @1 text\n\t//  email @2 text\n}\n```\n\n## Documentation\n\nFor more detailed documentation and additional functions, please visit the [official documentation](https://pkg.go.dev/github.com/devsisters/go-dyncapnp).\n\n## Contributing\n\nContributions are welcome! If you find any bugs or have any suggestions, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsisters%2Fgo-dyncapnp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsisters%2Fgo-dyncapnp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsisters%2Fgo-dyncapnp/lists"}