package avroimport ()// Decoder reads and decodes Avro values from an input stream.typeDecoderstruct { s Schema r *Reader}// NewDecoder returns a new decoder that reads from reader r using schema s.func ( string, io.Reader) (*Decoder, error) { , := Parse()if != nil {returnnil, }returnNewDecoderForSchema(, ), nil}// NewDecoderForSchema returns a new decoder that reads from r using schema.func ( Schema, io.Reader) *Decoder {returnDefaultConfig.NewDecoder(, )}// Decode reads the next Avro encoded value from its input and stores it in the value pointed to by v.func ( *Decoder) ( any) error {if .r.head == .r.tail && .r.reader != nil {if !.r.loadMore() {returnio.EOF } } .r.ReadVal(.s, )//nolint:errorlint // Only direct EOF errors should be discarded.if .r.Error == io.EOF {returnnil }return .r.Error}// Unmarshal parses the Avro encoded data and stores the result in the value pointed to by v.// If v is nil or not a pointer, Unmarshal returns an error.func ( Schema, []byte, any) error {returnDefaultConfig.Unmarshal(, , )}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.