source

package
v0.0.0-...-0afbe17 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIterator

func NewIterator(ctx context.Context, cfg IteratorConfig) error

NewTableIterator creates a new iterator goroutine and polls redshift for new records.

func NewSource

func NewSource() sdk.Source

NewSource initialises a new source.

Types

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

type IteratorConfig

type IteratorConfig struct {
	// contains filtered or unexported fields
}

type Position

type Position struct {
	TablePositions *csync.Map[string, TablePosition] `json:"tablePositions"` // Use csync.Map for thread safety
}

Position represents Redshift's position.

func NewPosition

func NewPosition() *Position

NewPosition initializes a new position when sdk position is nil.

func ParseSDKPosition

func ParseSDKPosition(position opencdc.Position) (*Position, error)

ParseSDKPosition parses opencdc.Position and returns Position.

type Source

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

Source is an Amazon Redshift source plugin.

func (*Source) Ack

func (s *Source) Ack(ctx context.Context, position opencdc.Position) error

Ack logs the debug event with the position.

func (*Source) Configure

func (s *Source) Configure(ctx context.Context, cfgRaw commonsConfig.Config) error

Configure parses and stores configurations, returns an error in case of invalid configuration.

func (*Source) Open

func (s *Source) Open(ctx context.Context, position opencdc.Position) error

Open parses the position and initializes the iterator.

func (*Source) Parameters

func (s *Source) Parameters() commonsConfig.Parameters

Parameters returns a map of named Parameters that describe how to configure the Source.

func (*Source) Read

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

Read returns the next record.

func (*Source) Teardown

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

Teardown gracefully shutdown connector.

type TablePosition

type TablePosition struct {
	// LastProcessedValue represents the last processed value from ordering column.
	LastProcessedValue any `json:"lastProcessedValue"`
	// LatestSnapshotValue represents the most recent value of ordering column.
	LatestSnapshotValue any `json:"latestSnapshotValue"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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