{"id":33035613,"url":"https://github.com/heetch/avro","last_synced_at":"2026-02-05T10:21:03.109Z","repository":{"id":39862232,"uuid":"231975000","full_name":"heetch/avro","owner":"heetch","description":"Avro codec and code generation for Go","archived":false,"fork":false,"pushed_at":"2025-03-18T10:39:18.000Z","size":459,"stargazers_count":88,"open_issues_count":40,"forks_count":15,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-18T11:36:09.489Z","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/heetch.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":"2020-01-05T20:57:10.000Z","updated_at":"2025-03-18T09:11:41.000Z","dependencies_parsed_at":"2024-06-18T15:24:26.698Z","dependency_job_id":"d4801f6e-1f45-4574-b2fe-75a308daadea","html_url":"https://github.com/heetch/avro","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/heetch/avro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Favro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Favro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Favro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Favro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heetch","download_url":"https://codeload.github.com/heetch/avro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heetch%2Favro/sbom","scorecard":{"id":459579,"data":{"date":"2025-08-11","repo":{"name":"github.com/heetch/avro","commit":"c612002e62474559797b2b51de4b14e33bf5beec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/avro.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/avro.yaml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/heetch/avro/avro.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/avro.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/heetch/avro/avro.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/avro.yaml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/heetch/avro/avro.yaml/master?enable=pin","Warn: goCommand not pinned by hash: .github/workflows/avro.yaml:68","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T10:44:06.340Z","repository_id":39862232,"created_at":"2025-08-19T10:44:06.341Z","updated_at":"2025-08-19T10:44:06.341Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29119231,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T09:40:36.738Z","status":"ssl_error","status_checked_at":"2026-02-05T09:36:49.977Z","response_time":65,"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":"2025-11-13T22:00:22.104Z","updated_at":"2026-02-05T10:21:03.089Z","avatar_url":"https://github.com/heetch.png","language":"Go","readme":"# Avro - Go-idiomatic encoding and decoding of Avro data\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/heetch/avro.svg)](https://pkg.go.dev/github.com/heetch/avro)\n\nThis package provides both a [code generator](https://pkg.go.dev/github.com/heetch/avro/cmd/avrogo) that generates Go data\nstructures from [Avro schemas](https://avro.apache.org/docs/1.9.1/spec.html) and a mapping between native\nGo data types and Avro schemas.\n\nThe API is modelled after that of Go's standard library [encoding/json\npackage](https://golang.org/pkg/encoding/json).\n\nThe documentation can be found [here](https://pkg.go.dev/github.com/heetch/avro).\n\nIt also provides support for encoding and decoding messages\nusing an [Avro schema registry](https://docs.confluent.io/current/schema-registry/index.html) - see\n[github.com/heetch/avro/avroregistry](https://pkg.go.dev/github.com/heetch/avro/avroregistry).\n\n## How are Avro schemas represented as Go datatypes?\n\nWhen the `avrogo` command generates Go datatypes from Avro schemas, it uses the following rules:\n\n- `\"int\"` is represented as `int`\n- `\"long\"` is represented as `int64`\n- `\"float\"` is represented as `float32`\n- `\"double\"` is represented as `float64`\n- `\"string\"` is represented as `string`\n- `\"boolean\"` is represented as `bool`\n- `\"bytes\"` is represented as `[]byte`\n- `\"null\"` is represented as the Go value `nil`\n- `{\"type\": \"array\", \"items\": T}` is represented as `[]T`\n- `{\"type\": \"map\", \"values\": T}` is represented as `map[string]T`\n- `{\"type\": \"enum\", \"name\": \"E\", \"symbols\": [\"red\", \"green\", \"blue\"]}` is represented a Go int type with `String`, `MarshalText` and `UnmarshalText` methods so it will encode as a string when used in JSON.\n- `{\"type\": \"fixed\", \"size\": 123, \"name\": \"F\"}` will encode as a Go `[123]byte`  type named `F`\n- `[\"null\", T]` encodes as `*T`\n- `[T, \"null\"]` encodes as `*T`\n- `[T₁, T₂, ...]` (a union) encodes as `interface{}` that should hold only the types for `T₁`, `T₂`, etc.\n- `{\"type\": \"record\", \"name\": \"R\", \"fields\": [....]}` encodes as a Go\n  struct type named `R` with corresponding fields.\n- `{\"type\": \"long\", \"logicalType\": \"timestamp-micros\"}` is represented\n  as `time.Time` type\n- `{\"type\": \"string\", \"logicalType\": \"uuid\"}` is represented as\n  [github.com/google/uuid.UUID](https://pkg.go.dev/github.com/google/uuid#UUID) type.\n- `{\"type\": \"long\", \"logicalType\": \"duration-nanos\"}` is represented as `time.Duration` type.\n\nIf a definition has a `go.package` annotation the type from that package will be used instead of generating a Go type. The type must be compatible with the Avro schema (it may contain extra fields, but all fields in common must be compatible).\n\nIf a definition has a `go.name` annotation the associated string will be used for the generated Go type name.\n\n## Comparison with other Go Avro packages\n\n[github.com/linkedin/goavro/v2](https://pkg.go.dev/github.com/linkedin/goavro/v2),\nis oriented towards dynamic processing of Avro data. It does not provide an idiomatic way to marshal/unmarshal\nAvro data into Go struct values. It does, however, provide good support for encoding and decoding with the\nstandard [Avro JSON format](https://avro.apache.org/docs/1.9.1/spec.html#json_encoding), which this\npackage does not.\n\n[github.com/actgardner/gogen-avro](https://github.com/actgardner/gogen-avro) was the original\ninspiration for this package. It generates Go code for Avro schemas. It uses a neat VM-based schema\nfor encoding and decoding (and is also used by this package under the hood), but the generated Go\ndata structures are awkward to use and don't reflect the data structures that people would idiomatically\ndefine in Go.\n\nFor example,  in `gogen-avro` the Avro type `[\"null\", \"int\"]` (either `null` or an integer) is represented as a\nstruct containing three members, and an associated enum type:\n\n```go\ntype UnionNullIntTypeEnum int\n\nconst (\n\tUnionNullIntTypeEnumNull UnionNullIntTypeEnum = 0\n\tUnionNullIntTypeEnumInt UnionNullIntTypeEnum = 1\n)\n\ntype UnionNullInt struct {\n\tNull *types.NullVal\n\tInt int32\n\tUnionType UnionNullIntTypeEnum\n}\n```\n\nWith `heetch/avro`, the above type is simply represented as a `*int`, a representation\nlikely to be familiar to most Go users.\n\n## Integration testing\n\nA `github.com/heetch/avro/avroregistrytest` package is provided to run\nintegration test against a real schema registry.\n\n```go\nimport \"github.com/heetch/avro/avroregistrytest\"\n\ntype X struct {\n   A int\n}\n\navroregistrytest.Register(context.Background(), t, A{}, \"test-topic\")\n```\n\nThis code snippet register an avro type for `X` struct for\n`test-topic` in the schema registry defined by `KAFKA_REGISTRY_ADDR`\nenvironment variable that must set to `host:port` form.\n","funding_links":[],"categories":["Kafka"],"sub_categories":["Infrastructure from code"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheetch%2Favro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheetch%2Favro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheetch%2Favro/lists"}