Documentation
¶
Index ¶
- func NewBatchDecoder(ctx context.Context, config *common.Config, db *sql.DB) (codec.RowEventDecoder, error)
- func NewBatchEncoder(config *common.Config, claimCheck *claimcheck.ClaimCheck) codec.RowEventEncoder
- func NewBatchEncoderBuilder(ctx context.Context, config *common.Config) (codec.RowEventEncoderBuilder, error)
- type BatchDecoder
- func (b *BatchDecoder) AddKeyValue(key, value []byte) error
- func (b *BatchDecoder) HasNext() (model.MessageType, bool, error)
- func (b *BatchDecoder) NextDDLEvent() (*model.DDLEvent, error)
- func (b *BatchDecoder) NextResolvedEvent() (uint64, error)
- func (b *BatchDecoder) NextRowChangedEvent() (*model.RowChangedEvent, error)
- type BatchEncoder
- func (d *BatchEncoder) AppendRowChangedEvent(ctx context.Context, _ string, e *model.RowChangedEvent, callback func()) error
- func (d *BatchEncoder) Build() (messages []*common.Message)
- func (d *BatchEncoder) EncodeCheckpointEvent(ts uint64) (*common.Message, error)
- func (d *BatchEncoder) EncodeDDLEvent(e *model.DDLEvent) (*common.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBatchDecoder ¶
func NewBatchDecoder(ctx context.Context, config *common.Config, db *sql.DB) (codec.RowEventDecoder, error)
NewBatchDecoder creates a new BatchDecoder.
func NewBatchEncoder ¶
func NewBatchEncoder(config *common.Config, claimCheck *claimcheck.ClaimCheck) codec.RowEventEncoder
NewBatchEncoder creates a new BatchEncoder.
func NewBatchEncoderBuilder ¶
func NewBatchEncoderBuilder( ctx context.Context, config *common.Config, ) (codec.RowEventEncoderBuilder, error)
NewBatchEncoderBuilder creates an open-protocol batchEncoderBuilder.
Types ¶
type BatchDecoder ¶
type BatchDecoder struct {
// contains filtered or unexported fields
}
BatchDecoder decodes the byte of a batch into the original messages.
func (*BatchDecoder) AddKeyValue ¶
func (b *BatchDecoder) AddKeyValue(key, value []byte) error
AddKeyValue implements the RowEventDecoder interface
func (*BatchDecoder) HasNext ¶
func (b *BatchDecoder) HasNext() (model.MessageType, bool, error)
HasNext implements the RowEventDecoder interface
func (*BatchDecoder) NextDDLEvent ¶
func (b *BatchDecoder) NextDDLEvent() (*model.DDLEvent, error)
NextDDLEvent implements the RowEventDecoder interface
func (*BatchDecoder) NextResolvedEvent ¶
func (b *BatchDecoder) NextResolvedEvent() (uint64, error)
NextResolvedEvent implements the RowEventDecoder interface
func (*BatchDecoder) NextRowChangedEvent ¶
func (b *BatchDecoder) NextRowChangedEvent() (*model.RowChangedEvent, error)
NextRowChangedEvent implements the RowEventDecoder interface
type BatchEncoder ¶
type BatchEncoder struct {
// contains filtered or unexported fields
}
BatchEncoder encodes the events into the byte of a batch into.
func (*BatchEncoder) AppendRowChangedEvent ¶
func (d *BatchEncoder) AppendRowChangedEvent( ctx context.Context, _ string, e *model.RowChangedEvent, callback func(), ) error
AppendRowChangedEvent implements the RowEventEncoder interface
func (*BatchEncoder) Build ¶
func (d *BatchEncoder) Build() (messages []*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 ¶
EncodeDDLEvent implements the RowEventEncoder interface