debezium

package
v0.0.0-...-6973b6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBatchEncoderBuilder

func NewBatchEncoderBuilder(config *common.Config, clusterID string) codec.RowEventEncoderBuilder

NewBatchEncoderBuilder creates a Debezium batchEncoderBuilder.

func NewDecoder

func NewDecoder(
	config *common.Config,
	db *sql.DB,
) codec.RowEventDecoder

NewDecoder return an debezium decoder

Types

type BatchEncoder

type BatchEncoder struct {
	// contains filtered or unexported fields
}

BatchEncoder encodes message into Debezium format.

func (*BatchEncoder) AppendRowChangedEvent

func (d *BatchEncoder) AppendRowChangedEvent(
	_ context.Context,
	_ string,
	e *model.RowChangedEvent,
	callback func(),
) error

AppendRowChangedEvent implements the RowEventEncoder interface

func (*BatchEncoder) Build

func (d *BatchEncoder) Build() []*common.Message

Build implements the RowEventEncoder interface

func (*BatchEncoder) EncodeCheckpointEvent

func (d *BatchEncoder) EncodeCheckpointEvent(ts uint64) (*common.Message, error)

EncodeCheckpointEvent implements the RowEventEncoder interface

func (*BatchEncoder) EncodeDDLEvent

func (d *BatchEncoder) EncodeDDLEvent(e *model.DDLEvent) (*common.Message, error)

EncodeDDLEvent implements the RowEventEncoder interface

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder implement the RowEventDecoder interface

func (*Decoder) AddKeyValue

func (d *Decoder) AddKeyValue(key, value []byte) error

AddKeyValue add the received key and values to the Decoder

func (*Decoder) HasNext

func (d *Decoder) HasNext() (model.MessageType, bool, error)

HasNext returns whether there is any event need to be consumed

func (*Decoder) NextDDLEvent

func (d *Decoder) NextDDLEvent() (*model.DDLEvent, error)

NextDDLEvent returns the next DDL event if exists

func (*Decoder) NextResolvedEvent

func (d *Decoder) NextResolvedEvent() (uint64, error)

NextResolvedEvent returns the next resolved event if exists

func (*Decoder) NextRowChangedEvent

func (d *Decoder) NextRowChangedEvent() (*model.RowChangedEvent, error)

NextRowChangedEvent returns the next row changed event if exists

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL