Documentation
¶
Index ¶
- Constants
- func NewSource() sdk.Source
- type CDCMode
- type Config
- type Iterator
- type SnapshotMode
- type Source
- func (s *Source) Ack(ctx context.Context, pos sdk.Position) error
- func (s *Source) Configure(ctx context.Context, cfgRaw map[string]string) error
- func (s *Source) Open(ctx context.Context, pos sdk.Position) error
- func (s *Source) Parameters() map[string]sdk.Parameter
- func (s *Source) Read(ctx context.Context) (sdk.Record, error)
- func (s *Source) Teardown(ctx context.Context) error
Constants ¶
View Source
const ( ConfigKeyURL = "url" ConfigKeyTable = "table" ConfigKeyColumns = "columns" ConfigKeyKey = "key" ConfigKeySnapshotMode = "snapshotMode" ConfigKeyCDCMode = "cdcMode" ConfigKeyLogreplPublicationName = "logrepl.publicationName" ConfigKeyLogreplSlotName = "logrepl.slotName" DefaultPublicationName = "conduitpub" DefaultSlotName = "conduitslot" )
Variables ¶
This section is empty.
Functions ¶
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" // CDCModeLongPolling uses long polling to listen to changes. CDCModeLongPolling CDCMode = "long_polling" )
type Config ¶
type Config struct {
URL string
Table string
Columns []string
Key string
// SnapshotMode determines if and when a snapshot is made.
SnapshotMode SnapshotMode
// CDCMode determines how the connector should listen to changes.
CDCMode CDCMode
// LogreplPublicationName determines the publication name in case the
// connector uses logical replication to listen to changes (see CDCMode).
LogreplPublicationName string
// LogreplSlotName determines the replication slot name in case the
// connector uses logical replication to listen to changes (see CDCMode).
LogreplSlotName string
}
type Iterator ¶
type Iterator interface {
// Next takes and returns the next record from the queue. Next is allowed to
// block until either a record is available or the context gets canceled.
Next(context.Context) (sdk.Record, error)
// Ack signals that a record at a specific position was successfully
// processed.
Ack(context.Context, sdk.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.