Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIsNotAvro = errors.New("Is not avro")
View Source
var SupportedSerializers = []string{
"raw", "protobuf", "avro", "msgpack", "base64",
}
Functions ¶
This section is empty.
Types ¶
type AvroSerializer ¶
type AvroSerializer struct {
// contains filtered or unexported fields
}
func NewAvroSerializer ¶
func NewAvroSerializer( avroSchemaCacheURL string, schemaID int, ) (*AvroSerializer, error)
type Base64Serializer ¶
type Base64Serializer struct{}
func NewBase64Serializer ¶
func NewBase64Serializer() *Base64Serializer
type DescriptorRegistry ¶
type DescriptorRegistry struct {
// contains filtered or unexported fields
}
func NewDescriptorRegistry ¶
func NewDescriptorRegistry(importPaths []string, exclusions []string) (*DescriptorRegistry, error)
func (*DescriptorRegistry) MessageForType ¶
func (d *DescriptorRegistry) MessageForType(_type string) *dynamic.Message
type MessagePackSerializer ¶
type MessagePackSerializer struct{}
func NewMessagePackSerializer ¶
func NewMessagePackSerializer() *MessagePackSerializer
type ProtobufSerializer ¶
type ProtobufSerializer struct {
// contains filtered or unexported fields
}
func NewProtobufSerializer ¶
func NewProtobufSerializer(importPaths, excludePath []string, protoType string) (*ProtobufSerializer, error)
func (*ProtobufSerializer) Decode ¶
func (ps *ProtobufSerializer) Decode(data []byte) ([]byte, error)
func (*ProtobufSerializer) Encode ¶
func (ps *ProtobufSerializer) Encode(raw []byte) ([]byte, error)
func (*ProtobufSerializer) GetExample ¶
func (ps *ProtobufSerializer) GetExample(protoType string) string
type RawSerializer ¶
type RawSerializer struct{}
func NewRawSerializer ¶
func NewRawSerializer() *RawSerializer
type SchemaCache ¶
type SchemaCache struct {
// contains filtered or unexported fields
}
SchemaCache connects to the Confluent schema registry and maintains a cached versions of Avro schemas and codecs.
func NewSchemaCache ¶
func NewSchemaCache(url string) (*SchemaCache, error)
NewSchemaCache returns a new Cache instance
func (*SchemaCache) DecodeMessage ¶
func (c *SchemaCache) DecodeMessage(b []byte) (message []byte, err error)
DecodeMessage returns a text representation of an Avro-encoded message.
func (*SchemaCache) EncodeMessage ¶
func (c *SchemaCache) EncodeMessage(schemaID int, json []byte) (message []byte, err error)
EncodeMessage returns a binary representation of an Avro-encoded message.
Click to show internal directories.
Click to hide internal directories.