snapshot

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIteratorDone = errors.New("snapshot complete")

Functions

This section is empty.

Types

type Config

type Config struct {
	Position     sdk.Position
	Tables       []string
	TableKeys    map[string]string
	TXSnapshotID string
}

type FetchConfig

type FetchConfig struct {
	Table        string
	Key          string
	TXSnapshotID string
	FetchSize    int
	Position     position.Position
}

func (FetchConfig) Validate

func (c FetchConfig) Validate() error

type FetchData

type FetchData struct {
	Key      sdk.StructuredData
	Payload  sdk.StructuredData
	Position position.SnapshotPosition
	Table    string
}

type FetchWorker

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

func NewFetchWorker

func NewFetchWorker(db *pgxpool.Pool, out chan<- FetchData, c FetchConfig) *FetchWorker

func (*FetchWorker) Run

func (f *FetchWorker) Run(ctx context.Context) error

func (*FetchWorker) Validate

func (f *FetchWorker) Validate(ctx context.Context) error

Validate will ensure the config is correct. * Table and keys exist * Key is a primary key

type Iterator

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

func NewIterator

func NewIterator(ctx context.Context, db *pgxpool.Pool, c Config) (*Iterator, error)

func (*Iterator) Ack

func (i *Iterator) Ack(_ context.Context, _ sdk.Position) error

func (*Iterator) Next

func (i *Iterator) Next(ctx context.Context) (sdk.Record, error)

func (*Iterator) Teardown

func (i *Iterator) Teardown(_ context.Context) error

Jump to

Keyboard shortcuts

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