Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidProtoIsNil is returned when trying to convert a schema object to a // proto schema, and the proto is nil. ErrInvalidProtoIsNil = errors.New("invalid proto: nil") // ErrUnsupportedType is returned when an unsupported type is encountered. ErrUnsupportedType = errors.New("unsupported type") )
View Source
var KnownSerdeFactories = map[Type]SerdeFactory{ TypeAvro: { Parse: func(s []byte) (Serde, error) { return avro.Parse(s) }, SerdeForType: func(v any) (Serde, error) { return avro.SerdeForType(v) }, }, }
Functions ¶
func AttachKeySchemaToRecord ¶
Types ¶
type Schema ¶
func (Schema) Fingerprint ¶
Fingerprint returns a unique 64 bit identifier for the schema.
func (*Schema) FromProto ¶
FromProto takes data from the supplied proto object and populates the receiver. If the proto object is nil, the receiver is set to its zero value. If the function returns an error, the receiver could be partially populated.
type Serde ¶
type Serde interface { // Marshal returns the encoded representation of v. Marshal(v any) ([]byte, error) // Unmarshal parses 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. Unmarshal(b []byte, v any) error // String returns the textual representation of the schema used by this serde. String() string }
Serde represents a serializer/deserializer.
type SerdeFactory ¶
type Type ¶
type Type int32
func (Type) MarshalText ¶
MarshalText returns the textual representation of the schema type.
func (*Type) UnmarshalText ¶
UnmarshalText parses the textual representation of the schema type.
Click to show internal directories.
Click to hide internal directories.