Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDCMode ¶
type CDCMode string
const ( // CDCModeAuto tries to set up logical replication and falls back to long // polling if that is impossible. CDCModeAuto CDCMode = "auto" // CDCModeLogrepl uses logical replication to listen to changes. CDCModeLogrepl CDCMode = "logrepl" // AllTablesWildcard can be used if you'd like to listen to all tables. AllTablesWildcard = "*" )
type Config ¶
type Config struct { sdk.DefaultSourceMiddleware // URL is the connection string for the Postgres database. URL string `json:"url" validate:"required"` // Tables is a List of table names to read from, separated by a comma, e.g.:"table1,table2". // Use "*" if you'd like to listen to all tables. Tables []string `json:"tables" validate:"required"` // SnapshotMode is whether the plugin will take a snapshot of the entire table before starting cdc mode. SnapshotMode SnapshotMode `json:"snapshotMode" validate:"inclusion=initial|never" default:"initial"` // Snapshot fetcher size determines the number of rows to retrieve at a time. SnapshotFetchSize int `json:"snapshot.fetchSize" default:"50000"` // CDCMode determines how the connector should listen to changes. CDCMode CDCMode `json:"cdcMode" validate:"inclusion=auto|logrepl" default:"auto"` // LogreplPublicationName determines the publication name in case the // connector uses logical replication to listen to changes (see CDCMode). LogreplPublicationName string `json:"logrepl.publicationName" default:"conduitpub"` // LogreplSlotName determines the replication slot name in case the // connector uses logical replication to listen to changes (see CDCMode). // Can only contain lower-case letters, numbers, and the underscore character. LogreplSlotName string `json:"logrepl.slotName" validate:"regex=^[a-z0-9_]+$" default:"conduitslot"` // LogreplAutoCleanup determines if the replication slot and publication should be // removed when the connector is deleted. LogreplAutoCleanup bool `json:"logrepl.autoCleanup" default:"true"` // WithAvroSchema determines whether the connector should attach an avro schema on each // record. WithAvroSchema bool `json:"logrepl.withAvroSchema" default:"true"` }
type Iterator ¶
type Iterator interface { // NextN takes and returns up to n records from the queue. NextN is allowed to // block until either at least one record is available or the context gets canceled. NextN(context.Context, int) ([]opencdc.Record, error) // Ack signals that a record at a specific position was successfully // processed. Ack(context.Context, opencdc.Position) error // Teardown attempts to gracefully teardown the iterator. Teardown(context.Context) error }
Iterator is an object that can iterate over a queue of records.
type SnapshotMode ¶
type SnapshotMode string
const ( // SnapshotModeInitial creates a snapshot in the first run of the pipeline. SnapshotModeInitial SnapshotMode = "initial" // SnapshotModeNever skips snapshot creation altogether. SnapshotModeNever SnapshotMode = "never" )
Click to show internal directories.
Click to hide internal directories.