Package Usage: go: gopkg.in/avro.v0
Package avro encodes/decodes avro schemas to your struct or a map.
Go-avro parses .avsc schemas from files and then lets you work with them.
When using SpecificDecoder, the implementation uses struct tags to map avro
messages into your struct. This helps because it makes schema evolution
easier and avoids having a ton of casting and dictionary checks in your
user code.
Say you had the schema:
This could be mapped to a SpecificRecord by using structs:
If the `avro:` struct tag is omitted, the default mapping lower-cases the first
letter only. It's better to just explicitly define where possible.
Mapped types:
Type unions are a bit more tricky. For a complex type union, the only valid
mapping is interface{}. However, for a type union with only "null" and one
other type (very typical) you can map it as a pointer type and keep type safety.
1 version
Latest release: over 7 years ago
56 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/gopkg.in/avro.v0