Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/travisturner/avro

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.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/travisturner/avro
License: Apache-2.0
Latest release: over 6 years ago
First release: over 6 years ago
Namespace: github.com/travisturner
Last synced: 14 days ago

    Loading...
    Readme
    Loading...