postgres

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Postgres connection URL. Required.
	URL string
	// BatchPageSize represents the size of the table page range that will be
	// processed concurrently by the table workers. Defaults to 1000.
	BatchPageSize uint
	// SchemaWorkers represents the number of tables the snapshot generator will
	// process concurrently per schema. Defaults to 4.
	SchemaWorkers uint
	// TableWorkers represents the number of concurrent workers per table. Each
	// worker will process a different page range in parallel. Defaults to 4.
	TableWorkers uint
}

type Option

type Option func(sg *SnapshotGenerator)

func WithLogger

func WithLogger(logger loglib.Logger) Option

type SnapshotGenerator

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

func NewSnapshotGenerator

func NewSnapshotGenerator(ctx context.Context, cfg *Config, processRow snapshot.RowProcessor, opts ...Option) (*SnapshotGenerator, error)

func (*SnapshotGenerator) Close

func (sg *SnapshotGenerator) Close() error

func (*SnapshotGenerator) CreateSnapshot

func (sg *SnapshotGenerator) CreateSnapshot(ctx context.Context, ss *snapshot.Snapshot) error

Jump to

Keyboard shortcuts

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