Documentation
¶
Index ¶
- Constants
- type ProtobufDeserializer
- type ProtobufSerializer
- func (ps *ProtobufSerializer) Serialize(pb proto.Message, ctx SerializationContext) ([]byte, error)
- func (ps *ProtobufSerializer) SetAutoRegisterSchemas(config ProtobufSerializerConfig) error
- func (ps *ProtobufSerializer) SetReferenceSubjectNameStrategy(config ProtobufSerializerConfig) error
- func (ps *ProtobufSerializer) SetSkipKnownTypes(config ProtobufSerializerConfig) error
- func (ps *ProtobufSerializer) SetSubjectNameStrategy(config ProtobufSerializerConfig) error
- func (ps *ProtobufSerializer) SetUseLatestVersion(config ProtobufSerializerConfig) error
- type ProtobufSerializerConfig
- type ProtobufSerializerConfigValue
- type RecordSubjectNameStrategy
- type ReferenceSubjectNameStrategy
- type SerializationContext
- type SubjectNameStrategy
- type SubjectNameStrategyForReferences
- type TopicRecordSubjectNameStrategy
- type TopicSubjectNameStrategy
Constants ¶
const ( // MessageFieldKey message field is key MessageFieldKey = "key" // MessageFieldValue message field is value MessageFieldValue = "value" // AutoRegisterSchemas auto register schemas AutoRegisterSchemas = "auto.register.schemas" // UseLatestVersion use latest version of schema UseLatestVersion = "use.latest.version" // SkipKnownTypes skips known types for schema references SkipKnownTypes = "skip.known.types" // SubjectNameStrategyImpl the implementation to use for determining subject naming strategy SubjectNameStrategyImpl = "subject.name.strategy" // ReferenceSubjectNameStrategyImpl the implementation to use for determining the subject naming strategy for references ReferenceSubjectNameStrategyImpl = "reference.subject.name.strategy" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtobufDeserializer ¶
type ProtobufDeserializer struct { }
ProtobufDeserializer using the schema registry client
func NewProtobufDeserializer ¶
func NewProtobufDeserializer() *ProtobufDeserializer
NewProtobufDeserializer returns a new ProtobufDeserializer
func (*ProtobufDeserializer) Deserialize ¶
func (ps *ProtobufDeserializer) Deserialize(bytes []byte, pb proto.Message) error
Deserialize using the Confluent Schema Registry wire format
type ProtobufSerializer ¶
type ProtobufSerializer struct {
// contains filtered or unexported fields
}
ProtobufSerializer using the schema registry client
func NewProtobufSerializer ¶
func NewProtobufSerializer(md protoreflect.MessageDescriptor, schemaRegistryClient srclient.ISchemaRegistryClient, config ProtobufSerializerConfig) (*ProtobufSerializer, error)
NewProtobufSerializer returns a new ProtobufSerializer
func (*ProtobufSerializer) Serialize ¶
func (ps *ProtobufSerializer) Serialize(pb proto.Message, ctx SerializationContext) ([]byte, error)
Serialize using the Confluent Schema Registry wire format
func (*ProtobufSerializer) SetAutoRegisterSchemas ¶
func (ps *ProtobufSerializer) SetAutoRegisterSchemas(config ProtobufSerializerConfig) error
SetAutoRegisterSchemas using the supplied ProtobufSerializerConfig
func (*ProtobufSerializer) SetReferenceSubjectNameStrategy ¶
func (ps *ProtobufSerializer) SetReferenceSubjectNameStrategy(config ProtobufSerializerConfig) error
SetReferenceSubjectNameStrategy using the supplied ProtobufSerializerConfig
func (*ProtobufSerializer) SetSkipKnownTypes ¶
func (ps *ProtobufSerializer) SetSkipKnownTypes(config ProtobufSerializerConfig) error
SetSkipKnownTypes using the supplied ProtobufSerializerConfig
func (*ProtobufSerializer) SetSubjectNameStrategy ¶
func (ps *ProtobufSerializer) SetSubjectNameStrategy(config ProtobufSerializerConfig) error
SetSubjectNameStrategy using the supplied ProtobufSerializerConfig
func (*ProtobufSerializer) SetUseLatestVersion ¶
func (ps *ProtobufSerializer) SetUseLatestVersion(config ProtobufSerializerConfig) error
SetUseLatestVersion using the supplied ProtobufSerializerConfig
type ProtobufSerializerConfig ¶
type ProtobufSerializerConfig map[string]ProtobufSerializerConfigValue
ProtobufSerializerConfig map of string to ProtobufSerializerConfigValue
type ProtobufSerializerConfigValue ¶
type ProtobufSerializerConfigValue interface{}
ProtobufSerializerConfigValue config values for protobuf serialization
type RecordSubjectNameStrategy ¶
type RecordSubjectNameStrategy struct{}
RecordSubjectNameStrategy uses the record name for the subject name
func (RecordSubjectNameStrategy) Subject ¶
func (RecordSubjectNameStrategy) Subject(_ SerializationContext, recordName string) string
Subject for RecordSubjectNameStrategy
type ReferenceSubjectNameStrategy ¶
type ReferenceSubjectNameStrategy struct{}
ReferenceSubjectNameStrategy use the reference name for the subject name for references
func (ReferenceSubjectNameStrategy) Subject ¶
func (ReferenceSubjectNameStrategy) Subject(_ SerializationContext, schemaRef protoreflect.FileImport) string
Subject for ReferenceSubjectNameStrategy
type SerializationContext ¶
SerializationContext extra context information to use for serialization
type SubjectNameStrategy ¶
type SubjectNameStrategy interface {
Subject(ctx SerializationContext, recordName string) string
}
SubjectNameStrategy how the subject is named, this will usually be based on the topic name
type SubjectNameStrategyForReferences ¶
type SubjectNameStrategyForReferences interface {
Subject(ctx SerializationContext, schemaRef protoreflect.FileImport) string
}
SubjectNameStrategyForReferences how the subject is named for references, this will usually just be the reference name
type TopicRecordSubjectNameStrategy ¶
type TopicRecordSubjectNameStrategy struct{}
TopicRecordSubjectNameStrategy uses the topic name and record name for the subject name
func (TopicRecordSubjectNameStrategy) Subject ¶
func (TopicRecordSubjectNameStrategy) Subject(ctx SerializationContext, recordName string) string
Subject for TopicRecordSubjectNameStrategy
type TopicSubjectNameStrategy ¶
type TopicSubjectNameStrategy struct{}
TopicSubjectNameStrategy uses the topic name for the subject name
func (TopicSubjectNameStrategy) Subject ¶
func (TopicSubjectNameStrategy) Subject(ctx SerializationContext, _ string) string
Subject for TopicSubjectNameStrategy