source

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

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

func NewSource

func NewSource() sdk.Source

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
}

func ParseConfig

func ParseConfig(cfgRaw map[string]string) (Config, error)

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"
)

type Source

type Source struct {
	sdk.UnimplementedSource
	// contains filtered or unexported fields
}

Source is a Postgres source plugin.

func (*Source) Ack

func (s *Source) Ack(ctx context.Context, pos sdk.Position) error

func (*Source) Configure

func (s *Source) Configure(ctx context.Context, cfgRaw map[string]string) error

func (*Source) Open

func (s *Source) Open(ctx context.Context, pos sdk.Position) error

func (*Source) Parameters added in v0.3.0

func (s *Source) Parameters() map[string]sdk.Parameter

func (*Source) Read

func (s *Source) Read(ctx context.Context) (sdk.Record, error)

func (*Source) Teardown

func (s *Source) Teardown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL