Versions in this module Expand all Collapse all v1 v1.0.0 Jul 10, 2023 Changes in this version + const Array + const Boolean + const Bytes + const Double + const Enum + const Fixed + const Float + const Int + const Long + const Map + const Null + const Record + const Recursive + const String + const Union + var ErrBlockNotFinished = errors.New("Block read is unfinished") + var ErrIntOverflow = errors.New("Overflowed an int value") + var ErrInvalidBool = errors.New("Invalid bool value") + var ErrInvalidFixedSize = errors.New("Invalid Fixed type size") + var ErrInvalidInt = errors.New("Invalid int value") + var ErrInvalidLong = errors.New("Invalid long value") + var ErrInvalidSchema = errors.New("Invalid schema") + var ErrInvalidStringLength = errors.New("Invalid string length") + var ErrLongOverflow = errors.New("Overflowed a long value") + var ErrNegativeBytesLength = errors.New("Negative bytes length") + var ErrNotAvroFile = errors.New("Not an Avro data file") + var ErrSchemaNotSet = errors.New("Schema not set") + var ErrUnexpectedEOF = io.ErrUnexpectedEOF + var ErrUnionTypeOverflow = errors.New("Union type overflow") + func GetFullName(schema Schema) string + func LoadSchemas(path string) map[string]Schema + func NewFieldDoesNotExistError(field string) error + type ArraySchema struct + Items Schema + Properties map[string]interface{} + func (*ArraySchema) GetName() string + func (*ArraySchema) Type() int + func (s *ArraySchema) MarshalJSON() ([]byte, error) + func (s *ArraySchema) Prop(key string) (interface{}, bool) + func (s *ArraySchema) String() string + func (s *ArraySchema) Validate(v reflect.Value) bool + type AvroRecord interface + Schema func() Schema + type BooleanSchema struct + func (*BooleanSchema) GetName() string + func (*BooleanSchema) MarshalJSON() ([]byte, error) + func (*BooleanSchema) Prop(key string) (interface{}, bool) + func (*BooleanSchema) String() string + func (*BooleanSchema) Type() int + func (*BooleanSchema) Validate(v reflect.Value) bool + type BytesSchema struct + func (*BytesSchema) GetName() string + func (*BytesSchema) MarshalJSON() ([]byte, error) + func (*BytesSchema) Prop(key string) (interface{}, bool) + func (*BytesSchema) String() string + func (*BytesSchema) Type() int + func (*BytesSchema) Validate(v reflect.Value) bool + type CodeGenerator struct + func NewCodeGenerator(schemas []string) *CodeGenerator + func (codegen *CodeGenerator) Generate() (string, error) + type DataBlock struct + BlockRemaining int64 + BlockSize int + NumEntries int64 + type DataFileReader struct + func NewDataFileReader(filename string, ignoreMe ...DatumReader) (*DataFileReader, error) + func (reader *DataFileReader) Close() error + func (reader *DataFileReader) Err() error + func (reader *DataFileReader) HasNext() bool + func (reader *DataFileReader) Next(v interface{}) error + func (reader *DataFileReader) NextBlock() error + type DataFileWriter struct + func NewDataFileWriter(output io.Writer, schema Schema, datumWriter DatumWriter) (writer *DataFileWriter, err error) + func (w *DataFileWriter) Close() error + func (w *DataFileWriter) Flush() error + func (w *DataFileWriter) Write(v interface{}) error + type DatumReader interface + Read func(v interface{}, dec Decoder) error + func NewDatumReader(schema Schema) DatumReader + type DatumWriter interface + Write func(obj interface{}, enc Encoder) error + func NewDatumWriter(schema Schema) DatumWriter + type Decoder interface + ArrayNext func() (int64, error) + MapNext func() (int64, error) + ReadArrayStart func() (int64, error) + ReadBoolean func() (bool, error) + ReadBytes func() ([]byte, error) + ReadDouble func() (float64, error) + ReadEnum func() (int32, error) + ReadFixed func([]byte) error + ReadFloat func() (float32, error) + ReadInt func() (int32, error) + ReadLong func() (int64, error) + ReadMapStart func() (int64, error) + ReadNull func() (interface{}, error) + ReadString func() (string, error) + func NewBinaryDecoder(buf []byte) Decoder + func NewBinaryDecoderReader(r io.Reader) Decoder + type DoubleSchema struct + func (*DoubleSchema) GetName() string + func (*DoubleSchema) MarshalJSON() ([]byte, error) + func (*DoubleSchema) Prop(key string) (interface{}, bool) + func (*DoubleSchema) String() string + func (*DoubleSchema) Type() int + func (*DoubleSchema) Validate(v reflect.Value) bool + type Encoder interface + WriteArrayNext func(int64) + WriteArrayStart func(int64) + WriteBoolean func(bool) + WriteBytes func([]byte) + WriteDouble func(float64) + WriteFloat func(float32) + WriteInt func(int32) + WriteLong func(int64) + WriteMapNext func(int64) + WriteMapStart func(int64) + WriteNull func(interface{}) + WriteRaw func([]byte) + WriteString func(string) + func NewBinaryEncoder(buffer io.Writer) Encoder + type EnumSchema struct + Aliases []string + Doc string + Name string + Namespace string + Properties map[string]interface{} + Symbols []string + func (*EnumSchema) Type() int + func (*EnumSchema) Validate(v reflect.Value) bool + func (s *EnumSchema) GetName() string + func (s *EnumSchema) MarshalJSON() ([]byte, error) + func (s *EnumSchema) Prop(key string) (interface{}, bool) + func (s *EnumSchema) String() string + type FixedSchema struct + Name string + Namespace string + Properties map[string]interface{} + Size int + func (*FixedSchema) Type() int + func (s *FixedSchema) GetName() string + func (s *FixedSchema) MarshalJSON() ([]byte, error) + func (s *FixedSchema) Prop(key string) (interface{}, bool) + func (s *FixedSchema) String() string + func (s *FixedSchema) Validate(v reflect.Value) bool + type FloatSchema struct + func (*FloatSchema) GetName() string + func (*FloatSchema) MarshalJSON() ([]byte, error) + func (*FloatSchema) Prop(key string) (interface{}, bool) + func (*FloatSchema) String() string + func (*FloatSchema) Type() int + func (*FloatSchema) Validate(v reflect.Value) bool + type GenericDatumReader struct + func NewGenericDatumReader() *GenericDatumReader + func (reader *GenericDatumReader) Read(v interface{}, dec Decoder) error + func (reader *GenericDatumReader) SetSchema(schema Schema) DatumReader + type GenericDatumWriter struct + func NewGenericDatumWriter() *GenericDatumWriter + func (writer *GenericDatumWriter) SetSchema(schema Schema) DatumWriter + func (writer *GenericDatumWriter) Write(obj interface{}, enc Encoder) error + type GenericEnum struct + Symbols []string + func NewGenericEnum(symbols []string) *GenericEnum + func (enum *GenericEnum) Get() string + func (enum *GenericEnum) GetIndex() int32 + func (enum *GenericEnum) Set(symbol string) + func (enum *GenericEnum) SetIndex(index int32) + type GenericRecord struct + func NewGenericRecord(schema Schema) *GenericRecord + func (gr *GenericRecord) Get(name string) interface{} + func (gr *GenericRecord) Map() map[string]interface{} + func (gr *GenericRecord) Schema() Schema + func (gr *GenericRecord) Set(name string, value interface{}) + func (gr *GenericRecord) String() string + type IntSchema struct + func (*IntSchema) GetName() string + func (*IntSchema) MarshalJSON() ([]byte, error) + func (*IntSchema) Prop(key string) (interface{}, bool) + func (*IntSchema) String() string + func (*IntSchema) Type() int + func (*IntSchema) Validate(v reflect.Value) bool + type LongSchema struct + func (*LongSchema) GetName() string + func (*LongSchema) MarshalJSON() ([]byte, error) + func (*LongSchema) Prop(key string) (interface{}, bool) + func (*LongSchema) String() string + func (*LongSchema) Type() int + func (*LongSchema) Validate(v reflect.Value) bool + type MapSchema struct + Properties map[string]interface{} + Values Schema + func (*MapSchema) GetName() string + func (*MapSchema) Type() int + func (s *MapSchema) MarshalJSON() ([]byte, error) + func (s *MapSchema) Prop(key string) (interface{}, bool) + func (s *MapSchema) String() string + func (s *MapSchema) Validate(v reflect.Value) bool + type Marshaler interface + MarshalAvro func(enc Encoder) error + type NullSchema struct + func (*NullSchema) GetName() string + func (*NullSchema) MarshalJSON() ([]byte, error) + func (*NullSchema) Prop(key string) (interface{}, bool) + func (*NullSchema) String() string + func (*NullSchema) Type() int + func (*NullSchema) Validate(v reflect.Value) bool + type RecordSchema struct + Aliases []string + Doc string + Fields []*SchemaField + Name string + Namespace string + Properties map[string]interface{} + func (*RecordSchema) Type() int + func (s *RecordSchema) GetName() string + func (s *RecordSchema) MarshalJSON() ([]byte, error) + func (s *RecordSchema) Prop(key string) (interface{}, bool) + func (s *RecordSchema) String() string + func (s *RecordSchema) Validate(v reflect.Value) bool + type RecursiveSchema struct + Actual *RecordSchema + func (*RecursiveSchema) Prop(key string) (interface{}, bool) + func (*RecursiveSchema) Type() int + func (s *RecursiveSchema) GetName() string + func (s *RecursiveSchema) MarshalJSON() ([]byte, error) + func (s *RecursiveSchema) String() string + func (s *RecursiveSchema) Validate(v reflect.Value) bool + type Schema interface + GetName func() string + Prop func(key string) (interface{}, bool) + String func() string + Type func() int + Validate func(v reflect.Value) bool + func MustParseSchema(rawSchema string) Schema + func ParseSchema(rawSchema string) (Schema, error) + func ParseSchemaFile(file string) (Schema, error) + func ParseSchemaWithRegistry(rawSchema string, schemas map[string]Schema) (Schema, error) + func Prepare(schema Schema) Schema + type SchemaField struct + Default interface{} + Doc string + Name string + Properties map[string]interface{} + Type Schema + func (s *SchemaField) MarshalJSON() ([]byte, error) + func (s *SchemaField) String() string + func (this *SchemaField) Prop(key string) (interface{}, bool) + type SpecificDatumReader struct + func NewSpecificDatumReader() *SpecificDatumReader + func (reader *SpecificDatumReader) Read(v interface{}, dec Decoder) error + func (reader *SpecificDatumReader) SetSchema(schema Schema) DatumReader + type SpecificDatumWriter struct + func NewSpecificDatumWriter() *SpecificDatumWriter + func (writer *SpecificDatumWriter) SetSchema(schema Schema) DatumWriter + func (writer *SpecificDatumWriter) Write(obj interface{}, enc Encoder) error + type StringSchema struct + func (*StringSchema) GetName() string + func (*StringSchema) MarshalJSON() ([]byte, error) + func (*StringSchema) Prop(key string) (interface{}, bool) + func (*StringSchema) String() string + func (*StringSchema) Type() int + func (*StringSchema) Validate(v reflect.Value) bool + type UnionSchema struct + Types []Schema + func (*UnionSchema) GetName() string + func (*UnionSchema) Prop(key string) (interface{}, bool) + func (*UnionSchema) Type() int + func (s *UnionSchema) GetType(v reflect.Value) int + func (s *UnionSchema) MarshalJSON() ([]byte, error) + func (s *UnionSchema) String() string + func (s *UnionSchema) Validate(v reflect.Value) bool + type Unmarshaler interface + UnmarshalAvro func(dec Decoder) error