Documentation
¶
Index ¶
- func Cleanup(ctx context.Context, c CleanupConfig) error
- type CDCConfig
- type CDCHandler
- type CDCIterator
- func (i *CDCIterator) Ack(_ context.Context, sdkPos opencdc.Position) error
- func (i *CDCIterator) NextN(ctx context.Context, n int) ([]opencdc.Record, error)
- func (i *CDCIterator) StartSubscriber(ctx context.Context) error
- func (i *CDCIterator) TXSnapshotID() string
- func (i *CDCIterator) Teardown(ctx context.Context) error
- type CleanupConfig
- type CombinedIterator
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CDCConfig ¶ added in v0.7.1
type CDCConfig struct { LSN pglogrepl.LSN SlotName string PublicationName string Tables []string TableKeys map[string]string WithAvroSchema bool // BatchSize is the maximum size of a batch that will be read from the DB // in one go and processed by the CDCHandler. BatchSize int }
CDCConfig holds configuration values for CDCIterator.
type CDCHandler ¶
type CDCHandler struct {
// contains filtered or unexported fields
}
CDCHandler is responsible for handling logical replication messages, converting them to a record and sending them to a channel.
func NewCDCHandler ¶
type CDCIterator ¶
type CDCIterator struct {
// contains filtered or unexported fields
}
CDCIterator asynchronously listens for events from the logical replication slot and returns them to the caller through NextN.
func NewCDCIterator ¶
NewCDCIterator initializes logical replication by creating the publication and subscription manager.
func (*CDCIterator) NextN ¶ added in v0.12.0
NextN returns up to n records from the internal channel with records. NextN is allowed to block until either at least one record is available or the context gets canceled.
func (*CDCIterator) StartSubscriber ¶ added in v0.7.1
func (i *CDCIterator) StartSubscriber(ctx context.Context) error
StartSubscriber starts the logical replication service in the background. Blocks until the subscription becomes ready.
func (*CDCIterator) TXSnapshotID ¶ added in v0.7.1
func (i *CDCIterator) TXSnapshotID() string
TXSnapshotID returns the transaction snapshot which is received when the replication slot is created. The value can be empty, when the iterator is resuming.
type CleanupConfig ¶ added in v0.7.1
type CombinedIterator ¶ added in v0.7.1
type CombinedIterator struct {
// contains filtered or unexported fields
}
func NewCombinedIterator ¶ added in v0.7.1
func NewCombinedIterator(ctx context.Context, pool *pgxpool.Pool, conf Config) (*CombinedIterator, error)
NewCombinedIterator will initialize and start the Snapshot and CDC iterators. Failure to parse the position or validate the config will return an error.