iterator

package
v0.0.0-...-69a6c05 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionInsert actionType = "INSERT"
	ActionUpdate actionType = "UPDATE"
	ActionDelete actionType = "DELETE"
)

Variables

View Source
var (
	ErrNoKey                     = errors.New("no key")
	ErrNoOrderingColumn          = errors.New("no ordering column")
	ErrWrongTrackingIDType       = errors.New("tracking id wrong type")
	ErrWrongTrackingOperatorType = errors.New("tracking column wrong type")
	ErrNoInitializedIterator     = errors.New("not initialized iterator")
	ErrUnknownOperatorType       = errors.New("unknown iterator type")
)

Functions

This section is empty.

Types

type CombinedIterator

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

CombinedIterator combined iterator.

func NewCombinedIterator

func NewCombinedIterator(ctx context.Context, params CombinedParams) (*CombinedIterator, error)

NewCombinedIterator - create new iterator.

func (*CombinedIterator) Ack

Ack check if record with position was recorded.

func (*CombinedIterator) HasNext

func (c *CombinedIterator) HasNext(ctx context.Context) (bool, error)

HasNext returns a bool indicating whether the iterator has the next record to return or not. If the underlying snapshot iterator returns false, the combined iterator will try to switch to the cdc iterator.

func (*CombinedIterator) Next

func (c *CombinedIterator) Next(ctx context.Context) (sdk.Record, error)

Next returns the next record.

func (*CombinedIterator) Stop

func (c *CombinedIterator) Stop() error

Stop the underlying iterators.

type CombinedParams

type CombinedParams struct {
	DB             *sqlx.DB
	Conn           string
	Table          string
	OrderingColumn string
	CfgKeys        []string
	Columns        []string
	BatchSize      int
	Snapshot       bool
	SdkPosition    sdk.Position
}

CombinedParams is an incoming params for the NewCombinedIterator function.

Jump to

Keyboard shortcuts

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