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) Next(ctx context.Context) (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 }
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 ¶
func NewCDCHandler(rs *internal.RelationSet, tableKeys map[string]string, out chan<- opencdc.Record) *CDCHandler
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 Next.
func NewCDCIterator ¶
NewCDCIterator initializes logical replication by creating the publication and subscription manager.
func (*CDCIterator) Next ¶
Next returns the next record retrieved from the subscription. This call will block until either a record is returned from the subscription, the subscription stops because of an error or the context gets canceled. Returns error when the subscription has been started.
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.