Documentation ¶
Index ¶
- type BuilderFunc
- type DefaultSessionPackers
- type Packer
- type PackerCacheFinalSchema
- func (c *PackerCacheFinalSchema) BuildFinalSchema(changeItem *abstract.ChangeItem, schemaBuilder BuilderFunc) ([]byte, error)
- func (c *PackerCacheFinalSchema) GetSchemaIDResolver() SchemaIDResolver
- func (c *PackerCacheFinalSchema) IsDropSchema() bool
- func (c *PackerCacheFinalSchema) Pack(changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, ...) ([]byte, error)
- type PackerIncludeSchema
- func (s *PackerIncludeSchema) BuildFinalSchema(changeItem *abstract.ChangeItem, schemaBuilder BuilderFunc) ([]byte, error)
- func (*PackerIncludeSchema) GetSchemaIDResolver() SchemaIDResolver
- func (s *PackerIncludeSchema) IsDropSchema() bool
- func (s *PackerIncludeSchema) Pack(changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, ...) ([]byte, error)
- type PackerSchemaRegistry
- func (s *PackerSchemaRegistry) BuildFinalSchema(changeItem *abstract.ChangeItem, kafkaSchemaBuilder BuilderFunc) ([]byte, error)
- func (s *PackerSchemaRegistry) GetSchemaIDResolver() SchemaIDResolver
- func (s *PackerSchemaRegistry) IsDropSchema() bool
- func (s *PackerSchemaRegistry) Pack(changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, ...) ([]byte, error)
- func (s *PackerSchemaRegistry) PackWithSchemaID(schemaID uint32, payload []byte) ([]byte, error)
- func (s *PackerSchemaRegistry) ResolveSchemaID(schema []byte, table abstract.TableID) (uint32, error)
- type PackerSkipSchema
- func (s *PackerSkipSchema) BuildFinalSchema(_ *abstract.ChangeItem, _ BuilderFunc) ([]byte, error)
- func (*PackerSkipSchema) GetSchemaIDResolver() SchemaIDResolver
- func (s *PackerSkipSchema) IsDropSchema() bool
- func (s *PackerSkipSchema) Pack(changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, _ BuilderFunc, ...) ([]byte, error)
- type SchemaIDResolver
- type SessionPackers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuilderFunc ¶
type BuilderFunc = func(changeItem *abstract.ChangeItem) ([]byte, error)
type DefaultSessionPackers ¶
type DefaultSessionPackers struct {
// contains filtered or unexported fields
}
func NewDefaultSessionPackers ¶
func NewDefaultSessionPackers(k, v Packer) *DefaultSessionPackers
func (*DefaultSessionPackers) Packer ¶
func (p *DefaultSessionPackers) Packer(isKey bool) Packer
type Packer ¶
type Packer interface { // Pack - builds payload & schema into message Pack( changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, kafkaSchemaBuilder BuilderFunc, maybeCachedRawSchema []byte, ) ([]byte, error) // BuildFinalSchema // This interface is used for caching // If your packer is wrapped into 'PackerCacheFinalSchema' - it will call BuildFinalSchema only when schema is not cached BuildFinalSchema(changeItem *abstract.ChangeItem, kafkaSchemaBuilder BuilderFunc) ([]byte, error) IsDropSchema() bool GetSchemaIDResolver() SchemaIDResolver }
type PackerCacheFinalSchema ¶
type PackerCacheFinalSchema struct {
// contains filtered or unexported fields
}
func NewPackerCacheFinalSchema ¶
func NewPackerCacheFinalSchema(in Packer) *PackerCacheFinalSchema
func (*PackerCacheFinalSchema) BuildFinalSchema ¶
func (c *PackerCacheFinalSchema) BuildFinalSchema(changeItem *abstract.ChangeItem, schemaBuilder BuilderFunc) ([]byte, error)
func (*PackerCacheFinalSchema) GetSchemaIDResolver ¶
func (c *PackerCacheFinalSchema) GetSchemaIDResolver() SchemaIDResolver
func (*PackerCacheFinalSchema) IsDropSchema ¶
func (c *PackerCacheFinalSchema) IsDropSchema() bool
func (*PackerCacheFinalSchema) Pack ¶
func (c *PackerCacheFinalSchema) Pack( changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, kafkaSchemaBuilder BuilderFunc, _ []byte, ) ([]byte, error)
type PackerIncludeSchema ¶
type PackerIncludeSchema struct{}
func NewPackerIncludeSchema ¶
func NewPackerIncludeSchema() *PackerIncludeSchema
func (*PackerIncludeSchema) BuildFinalSchema ¶
func (s *PackerIncludeSchema) BuildFinalSchema(changeItem *abstract.ChangeItem, schemaBuilder BuilderFunc) ([]byte, error)
func (*PackerIncludeSchema) GetSchemaIDResolver ¶
func (*PackerIncludeSchema) GetSchemaIDResolver() SchemaIDResolver
func (*PackerIncludeSchema) IsDropSchema ¶
func (s *PackerIncludeSchema) IsDropSchema() bool
func (*PackerIncludeSchema) Pack ¶
func (s *PackerIncludeSchema) Pack( changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, kafkaSchemaBuilder BuilderFunc, maybeCachedRawSchema []byte, ) ([]byte, error)
type PackerSchemaRegistry ¶
type PackerSchemaRegistry struct {
// contains filtered or unexported fields
}
func NewPackerSchemaRegistry ¶
func NewPackerSchemaRegistry( srClient *confluent.SchemaRegistryClient, subjectNameStrategy string, isKeyProcessor bool, writeIntoOneTopic bool, topic string, ) *PackerSchemaRegistry
func (*PackerSchemaRegistry) BuildFinalSchema ¶
func (s *PackerSchemaRegistry) BuildFinalSchema(changeItem *abstract.ChangeItem, kafkaSchemaBuilder BuilderFunc) ([]byte, error)
func (*PackerSchemaRegistry) GetSchemaIDResolver ¶
func (s *PackerSchemaRegistry) GetSchemaIDResolver() SchemaIDResolver
func (*PackerSchemaRegistry) IsDropSchema ¶
func (s *PackerSchemaRegistry) IsDropSchema() bool
func (*PackerSchemaRegistry) Pack ¶
func (s *PackerSchemaRegistry) Pack( changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, kafkaSchemaBuilder BuilderFunc, maybeCachedRawSchema []byte, ) ([]byte, error)
func (*PackerSchemaRegistry) PackWithSchemaID ¶
func (s *PackerSchemaRegistry) PackWithSchemaID(schemaID uint32, payload []byte) ([]byte, error)
func (*PackerSchemaRegistry) ResolveSchemaID ¶
type PackerSkipSchema ¶
type PackerSkipSchema struct { }
func NewPackerSkipSchema ¶
func NewPackerSkipSchema() *PackerSkipSchema
func (*PackerSkipSchema) BuildFinalSchema ¶
func (s *PackerSkipSchema) BuildFinalSchema(_ *abstract.ChangeItem, _ BuilderFunc) ([]byte, error)
func (*PackerSkipSchema) GetSchemaIDResolver ¶
func (*PackerSkipSchema) GetSchemaIDResolver() SchemaIDResolver
func (*PackerSkipSchema) IsDropSchema ¶
func (s *PackerSkipSchema) IsDropSchema() bool
func (*PackerSkipSchema) Pack ¶
func (s *PackerSkipSchema) Pack( changeItem *abstract.ChangeItem, payloadBuilder BuilderFunc, _ BuilderFunc, _ []byte, ) ([]byte, error)
type SchemaIDResolver ¶
type SchemaIDResolver interface { ResolveSchemaID(schema []byte, table abstract.TableID) (uint32, error) PackWithSchemaID(schemaID uint32, payload []byte) ([]byte, error) }
SchemaIDResolver If there are packer with schemaRegistry and wrapped into schemaID resolver It would be called ResolveSchemaID+PackWithSchemaID except 'Pack'
type SessionPackers ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.