Documentation ¶
Overview ¶
gogen-avro's internal representation of Avro schemas
Index ¶
- type AbstractType
- type ArrayField
- func (q *ArrayField) Aliases() []QualifiedName
- func (s *ArrayField) Children() []AvroType
- func (s *ArrayField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (s *ArrayField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (s *ArrayField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
- func (s *ArrayField) ItemConstructable() string
- func (s *ArrayField) ItemType() AvroType
- func (q *ArrayField) QualifiedName() QualifiedName
- func (s *ArrayField) Resolve(ref Reference)
- func (s *ArrayField) WrapperType() string
- type AvroType
- type BoolField
- type BytesField
- type CompositeType
- type Constructable
- type DoubleField
- type EnumDefinition
- func (q *EnumDefinition) Aliases() []QualifiedName
- func (s *EnumDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (q *EnumDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (e *EnumDefinition) Doc() string
- func (s *EnumDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
- func (q *EnumDefinition) QualifiedName() QualifiedName
- func (e *EnumDefinition) SymbolName(symbol string) string
- func (e *EnumDefinition) Symbols() []string
- func (s *EnumDefinition) WrapperType() string
- type Field
- func (f *Field) Default() interface{}
- func (f *Field) Definition(scope map[QualifiedName]interface{}) (map[string]interface{}, error)
- func (f *Field) Doc() string
- func (p *Field) GoType() string
- func (f *Field) HasDefault() bool
- func (f *Field) Index() int
- func (p *Field) IsOptional() bool
- func (p *Field) Name() string
- func (p *Field) SimpleName() string
- func (f *Field) Tags() string
- func (f *Field) Type() AvroType
- type FixedDefinition
- func (q *FixedDefinition) Aliases() []QualifiedName
- func (s *FixedDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (q *FixedDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (s *FixedDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
- func (q *FixedDefinition) QualifiedName() QualifiedName
- func (s *FixedDefinition) SizeBytes() int
- type FloatField
- type IntField
- type LongField
- type MapField
- func (s *MapField) Children() []AvroType
- func (s *MapField) ConstructorMethod() string
- func (s *MapField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (s *MapField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (s *MapField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
- func (s *MapField) ItemConstructable() string
- func (s *MapField) ItemType() AvroType
- func (p *MapField) SerializerMethod() string
- func (p *MapField) WrapperType() string
- type NullField
- type QualifiedAvroType
- type QualifiedName
- type RecordDefinition
- func (q *RecordDefinition) Aliases() []QualifiedName
- func (s *RecordDefinition) Children() []AvroType
- func (r *RecordDefinition) ConstructableForField(f *Field) string
- func (r *RecordDefinition) ConstructorMethod() string
- func (r *RecordDefinition) DefaultForField(f *Field) (string, error)
- func (r *RecordDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (r *RecordDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (s *RecordDefinition) Doc() string
- func (r *RecordDefinition) Fields() []*Field
- func (r *RecordDefinition) GetReaderField(writerField *Field) *Field
- func (s *RecordDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
- func (q *RecordDefinition) QualifiedName() QualifiedName
- func (s *RecordDefinition) Schema() (string, error)
- type Reference
- func (r *Reference) AddResolver(resolver referenceResolver)
- func (r Reference) Aliases() []QualifiedName
- func (r Reference) Children() []AvroType
- func (r Reference) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (r Reference) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (r Reference) GoType() string
- func (r Reference) IsOptional() bool
- func (r Reference) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
- func (r Reference) IsUntyped() bool
- func (r Reference) Name() string
- func (r Reference) QualifiedName() QualifiedName
- func (r Reference) RefName() QualifiedName
- func (r Reference) RefType() QualifiedAvroType
- func (r Reference) SerializerMethod() string
- func (r *Reference) SetType(t QualifiedAvroType)
- func (r Reference) SimpleName() string
- func (r Reference) WrapperType() string
- type StringField
- type UnionField
- func (q *UnionField) Aliases() []QualifiedName
- func (s *UnionField) Children() []AvroType
- func (s *UnionField) ConstructorMethod() string
- func (s *UnionField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
- func (s *UnionField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
- func (s *UnionField) Equals(reader *UnionField) bool
- func (s *UnionField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
- func (s *UnionField) ItemConstructor(f AvroType) string
- func (s *UnionField) ItemName(item AvroType) string
- func (s *UnionField) ItemTypes() []AvroType
- func (s *UnionField) OptionalIndex() int
- func (q *UnionField) QualifiedName() QualifiedName
- func (u *UnionField) Resolve(ref Reference)
- func (s *UnionField) UnionEnumType() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractType ¶
type ArrayField ¶
type ArrayField struct {
// contains filtered or unexported fields
}
func NewArrayField ¶
func NewArrayField(itemType AvroType, definition map[string]interface{}) *ArrayField
func (*ArrayField) Aliases ¶
func (q *ArrayField) Aliases() []QualifiedName
func (*ArrayField) Children ¶
func (s *ArrayField) Children() []AvroType
func (*ArrayField) DefaultValue ¶
func (s *ArrayField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*ArrayField) Definition ¶
func (s *ArrayField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*ArrayField) IsReadableBy ¶
func (s *ArrayField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*ArrayField) ItemConstructable ¶
func (s *ArrayField) ItemConstructable() string
func (*ArrayField) ItemType ¶
func (s *ArrayField) ItemType() AvroType
func (*ArrayField) QualifiedName ¶
func (q *ArrayField) QualifiedName() QualifiedName
func (*ArrayField) Resolve ¶
func (s *ArrayField) Resolve(ref Reference)
Resolve runtime data when item type is a reference, since its data cannot be always known at this array's creation time.
func (*ArrayField) WrapperType ¶
func (s *ArrayField) WrapperType() string
type AvroType ¶
type AvroType interface { AbstractType // The name of the method which writes this field onto the wire SerializerMethod() string DefaultValue(lvalue string, rvalue interface{}) (string, error) WrapperType() string IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool }
type BoolField ¶
type BoolField struct {
// contains filtered or unexported fields
}
func NewBoolField ¶
func NewBoolField(definition interface{}) *BoolField
func (*BoolField) DefaultValue ¶
func (*BoolField) IsReadableBy ¶
func (s *BoolField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*BoolField) SerializerMethod ¶
func (p *BoolField) SerializerMethod() string
func (*BoolField) WrapperType ¶
type BytesField ¶
type BytesField struct {
// contains filtered or unexported fields
}
func NewBytesField ¶
func NewBytesField(definition interface{}) *BytesField
func (*BytesField) DefaultValue ¶
func (s *BytesField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*BytesField) IsReadableBy ¶
func (s *BytesField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*BytesField) SerializerMethod ¶
func (p *BytesField) SerializerMethod() string
func (*BytesField) WrapperType ¶
func (s *BytesField) WrapperType() string
type CompositeType ¶
CompositeType must be implemented by any type containing children (array, record and union)
type Constructable ¶
type Constructable interface {
ConstructorMethod() string
}
type DoubleField ¶
type DoubleField struct {
// contains filtered or unexported fields
}
func NewDoubleField ¶
func NewDoubleField(definition interface{}) *DoubleField
func (*DoubleField) DefaultValue ¶
func (s *DoubleField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*DoubleField) IsReadableBy ¶
func (s *DoubleField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*DoubleField) SerializerMethod ¶
func (p *DoubleField) SerializerMethod() string
func (*DoubleField) WrapperType ¶
func (s *DoubleField) WrapperType() string
type EnumDefinition ¶
type EnumDefinition struct {
// contains filtered or unexported fields
}
func NewEnumDefinition ¶
func NewEnumDefinition(qname QualifiedName, aliases []QualifiedName, symbols []string, doc string, definition interface{}) *EnumDefinition
func (*EnumDefinition) Aliases ¶
func (q *EnumDefinition) Aliases() []QualifiedName
func (*EnumDefinition) DefaultValue ¶
func (s *EnumDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*EnumDefinition) Definition ¶
func (q *EnumDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*EnumDefinition) Doc ¶
func (e *EnumDefinition) Doc() string
func (*EnumDefinition) IsReadableBy ¶
func (s *EnumDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
func (*EnumDefinition) QualifiedName ¶
func (q *EnumDefinition) QualifiedName() QualifiedName
func (*EnumDefinition) SymbolName ¶
func (e *EnumDefinition) SymbolName(symbol string) string
func (*EnumDefinition) Symbols ¶
func (e *EnumDefinition) Symbols() []string
func (*EnumDefinition) WrapperType ¶
func (s *EnumDefinition) WrapperType() string
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) Definition ¶
func (f *Field) Definition(scope map[QualifiedName]interface{}) (map[string]interface{}, error)
func (*Field) HasDefault ¶
func (*Field) IsOptional ¶
func (p *Field) IsOptional() bool
func (*Field) SimpleName ¶
func (p *Field) SimpleName() string
type FixedDefinition ¶
type FixedDefinition struct {
// contains filtered or unexported fields
}
func NewFixedDefinition ¶
func NewFixedDefinition(qname QualifiedName, aliases []QualifiedName, sizeBytes int, definition interface{}) *FixedDefinition
func (*FixedDefinition) Aliases ¶
func (q *FixedDefinition) Aliases() []QualifiedName
func (*FixedDefinition) DefaultValue ¶
func (s *FixedDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*FixedDefinition) Definition ¶
func (q *FixedDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*FixedDefinition) IsReadableBy ¶
func (s *FixedDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
func (*FixedDefinition) QualifiedName ¶
func (q *FixedDefinition) QualifiedName() QualifiedName
func (*FixedDefinition) SizeBytes ¶
func (s *FixedDefinition) SizeBytes() int
type FloatField ¶
type FloatField struct {
// contains filtered or unexported fields
}
func NewFloatField ¶
func NewFloatField(definition interface{}) *FloatField
func (*FloatField) DefaultValue ¶
func (s *FloatField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*FloatField) IsReadableBy ¶
func (s *FloatField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*FloatField) SerializerMethod ¶
func (p *FloatField) SerializerMethod() string
func (*FloatField) WrapperType ¶
func (s *FloatField) WrapperType() string
type IntField ¶
type IntField struct {
// contains filtered or unexported fields
}
func NewIntField ¶
func NewIntField(definition interface{}) *IntField
func (*IntField) DefaultValue ¶
func (*IntField) IsReadableBy ¶
func (s *IntField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*IntField) SerializerMethod ¶
func (p *IntField) SerializerMethod() string
func (*IntField) WrapperType ¶
type LongField ¶
type LongField struct {
// contains filtered or unexported fields
}
func NewLongField ¶
func NewLongField(definition interface{}) *LongField
func (*LongField) DefaultValue ¶
func (*LongField) IsReadableBy ¶
func (s *LongField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*LongField) SerializerMethod ¶
func (p *LongField) SerializerMethod() string
func (*LongField) WrapperType ¶
type MapField ¶
type MapField struct {
// contains filtered or unexported fields
}
func NewMapField ¶
func (*MapField) ConstructorMethod ¶
func (*MapField) DefaultValue ¶
func (*MapField) Definition ¶
func (s *MapField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*MapField) IsReadableBy ¶
func (s *MapField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*MapField) ItemConstructable ¶
func (*MapField) SerializerMethod ¶
func (p *MapField) SerializerMethod() string
func (*MapField) WrapperType ¶
func (p *MapField) WrapperType() string
type NullField ¶
type NullField struct {
// contains filtered or unexported fields
}
func NewNullField ¶
func NewNullField(definition interface{}) *NullField
func (*NullField) DefaultValue ¶
func (*NullField) IsReadableBy ¶
func (s *NullField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*NullField) SerializerMethod ¶
func (p *NullField) SerializerMethod() string
func (*NullField) WrapperType ¶
func (p *NullField) WrapperType() string
type QualifiedAvroType ¶
type QualifiedAvroType interface { AvroType QualifiedName() QualifiedName Aliases() []QualifiedName }
type QualifiedName ¶
QualifiedName represents an Avro qualified name, which includes an optional namespace and the type name.
func (QualifiedName) String ¶
func (q QualifiedName) String() string
type RecordDefinition ¶
type RecordDefinition struct {
// contains filtered or unexported fields
}
func NewRecordDefinition ¶
func NewRecordDefinition(qname QualifiedName, aliases []QualifiedName, fields []*Field, doc string, definition interface{}) *RecordDefinition
func (*RecordDefinition) Aliases ¶
func (q *RecordDefinition) Aliases() []QualifiedName
func (*RecordDefinition) Children ¶
func (s *RecordDefinition) Children() []AvroType
func (*RecordDefinition) ConstructableForField ¶
func (r *RecordDefinition) ConstructableForField(f *Field) string
func (*RecordDefinition) ConstructorMethod ¶
func (r *RecordDefinition) ConstructorMethod() string
func (*RecordDefinition) DefaultForField ¶
func (r *RecordDefinition) DefaultForField(f *Field) (string, error)
func (*RecordDefinition) DefaultValue ¶
func (r *RecordDefinition) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*RecordDefinition) Definition ¶
func (r *RecordDefinition) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*RecordDefinition) Doc ¶
func (s *RecordDefinition) Doc() string
func (*RecordDefinition) Fields ¶
func (r *RecordDefinition) Fields() []*Field
func (*RecordDefinition) GetReaderField ¶
func (r *RecordDefinition) GetReaderField(writerField *Field) *Field
func (*RecordDefinition) IsReadableBy ¶
func (s *RecordDefinition) IsReadableBy(d AvroType, visited map[QualifiedName]interface{}) bool
func (*RecordDefinition) QualifiedName ¶
func (q *RecordDefinition) QualifiedName() QualifiedName
func (*RecordDefinition) Schema ¶
func (s *RecordDefinition) Schema() (string, error)
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
A named Reference to a user-defined type (fixed, enum, record). Just a wrapper with a name around a qnamed type. If a reference is created without a defined type, all parsing-time values are returned as invalid values. Once the reference gets assigned a type, it triggers its registered resolvers' Resolve(ref) method. This is commonly transparent for almost all types, but some other types depend on their children fields for defining their internal data, like Name and GoType. Examples of this are: - Arrays of base types defined as references: the resolver renames the array to its final name. - Union types with named-types' members: once all its children refs are triggered, the union gets renamed.
func NewReference ¶
func NewReference(name QualifiedName, t QualifiedAvroType) *Reference
func (*Reference) AddResolver ¶
func (r *Reference) AddResolver(resolver referenceResolver)
func (Reference) Aliases ¶
func (r Reference) Aliases() []QualifiedName
func (Reference) DefaultValue ¶
func (Reference) Definition ¶
func (r Reference) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (Reference) IsOptional ¶
func (Reference) IsReadableBy ¶
func (r Reference) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (Reference) QualifiedName ¶
func (r Reference) QualifiedName() QualifiedName
func (Reference) RefName ¶
func (r Reference) RefName() QualifiedName
func (Reference) RefType ¶
func (r Reference) RefType() QualifiedAvroType
func (Reference) SerializerMethod ¶
The name of the method which writes this field onto the wire
func (*Reference) SetType ¶
func (r *Reference) SetType(t QualifiedAvroType)
func (Reference) SimpleName ¶
func (Reference) WrapperType ¶
type StringField ¶
type StringField struct {
// contains filtered or unexported fields
}
func NewStringField ¶
func NewStringField(definition interface{}) *StringField
func (*StringField) DefaultValue ¶
func (s *StringField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*StringField) IsReadableBy ¶
func (s *StringField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*StringField) SerializerMethod ¶
func (p *StringField) SerializerMethod() string
func (*StringField) WrapperType ¶
func (s *StringField) WrapperType() string
type UnionField ¶
type UnionField struct {
// contains filtered or unexported fields
}
func NewUnionField ¶
func NewUnionField(name string, children []AvroType, definition []interface{}) *UnionField
func (*UnionField) Aliases ¶
func (q *UnionField) Aliases() []QualifiedName
func (*UnionField) Children ¶
func (s *UnionField) Children() []AvroType
func (*UnionField) ConstructorMethod ¶
func (s *UnionField) ConstructorMethod() string
func (*UnionField) DefaultValue ¶
func (s *UnionField) DefaultValue(lvalue string, rvalue interface{}) (string, error)
func (*UnionField) Definition ¶
func (s *UnionField) Definition(scope map[QualifiedName]interface{}) (interface{}, error)
func (*UnionField) Equals ¶
func (s *UnionField) Equals(reader *UnionField) bool
func (*UnionField) IsReadableBy ¶
func (s *UnionField) IsReadableBy(f AvroType, visited map[QualifiedName]interface{}) bool
func (*UnionField) ItemConstructor ¶
func (s *UnionField) ItemConstructor(f AvroType) string
func (*UnionField) ItemName ¶
func (s *UnionField) ItemName(item AvroType) string
func (*UnionField) ItemTypes ¶
func (s *UnionField) ItemTypes() []AvroType
func (*UnionField) OptionalIndex ¶
func (s *UnionField) OptionalIndex() int
func (*UnionField) QualifiedName ¶
func (q *UnionField) QualifiedName() QualifiedName
func (*UnionField) Resolve ¶
func (u *UnionField) Resolve(ref Reference)
Resolve runtime data when item type is a reference, since its data cannot be always known at this array's creation time.
func (*UnionField) UnionEnumType ¶
func (s *UnionField) UnionEnumType() string
Source Files ¶
- abstract_field.go
- abstract_type.go
- array.go
- avro_type.go
- bool.go
- bytes.go
- composite_type.go
- constructable.go
- double.go
- enum.go
- field.go
- fixed.go
- float.go
- int.go
- long.go
- map.go
- null.go
- primitive_field.go
- qualified_avro_type.go
- qualified_field.go
- qualified_name.go
- record.go
- reference.go
- string.go
- union.go
Click to show internal directories.
Click to hide internal directories.