Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSnapshotComplete = errors.New("snapshot complete")
ErrSnapshotComplete is returned by Next when a snapshot is finished
var ErrSnapshotInterrupt = errors.New("snapshot interrupted")
ErrSnapshotInterrupt is returned by Teardown when a snapshot is interrupted
Functions ¶
func LSNToPosition ¶
LSNToPosition converts a Postgres LSN to a Conduit position.
Types ¶
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<- sdk.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 ¶
func NewCDCIterator(ctx context.Context, connPool *pgxpool.Pool, config Config) (*CDCIterator, error)
NewCDCIterator sets up the subscription to a logical replication slot and starts a goroutine that listens to events. The goroutine will keep running until either the context is canceled or Teardown is called.
type Config ¶
type Config struct { Position sdk.Position SlotName string PublicationName string Tables []string TableKeys map[string]string }
Config holds configuration values for CDCIterator.
type SnapshotConfig ¶ added in v0.3.0
type SnapshotIterator ¶ added in v0.3.0
type SnapshotIterator struct {
// contains filtered or unexported fields
}
func NewSnapshotIterator ¶ added in v0.3.0
func NewSnapshotIterator(ctx context.Context, conn *pgx.Conn, cfg SnapshotConfig) (*SnapshotIterator, error)