iterator

package
v0.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCDCIteratorIsStopped = errors.New("CDC iterator is stopped")
View Source
var ErrSnapshotIteratorIsStopped = errors.New("snapshot iterator is stopped")
View Source
var ErrUnsupportedIterator = errors.New("unsupported iterator")

Functions

This section is empty.

Types

type CDCIterator

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

func NewCDCIterator

func NewCDCIterator(
	pollingPeriod time.Duration,
	client *container.Client,
	from time.Time,
	maxResults int32,
) (*CDCIterator, error)

func (*CDCIterator) HasNext

func (w *CDCIterator) HasNext(_ context.Context) bool

func (*CDCIterator) Next

func (w *CDCIterator) Next(ctx context.Context) (opencdc.Record, error)

func (*CDCIterator) Stop

func (w *CDCIterator) Stop()

type CombinedIterator

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

func NewCombinedIterator

func NewCombinedIterator(
	pollingPeriod time.Duration,
	client *container.Client,
	maxResults int32,
	p position.Position,
) (c *CombinedIterator, err error)

func (*CombinedIterator) HasNext

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

func (*CombinedIterator) Next

func (*CombinedIterator) Stop

func (c *CombinedIterator) Stop()

type Iterator

type Iterator interface {
	// HasNext indicates whether there is new opencdc.Record available (`true`) or not (`false`)
	HasNext(ctx context.Context) bool

	// Next returns new opencdc.Record while reading the container or error when operation failed
	Next(ctx context.Context) (opencdc.Record, error)

	// Stop informs the iterator to stop processing new records.
	// All currently ongoing operations should be gracefully shut down.
	Stop()
}

type SnapshotIterator

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

func NewSnapshotIterator

func NewSnapshotIterator(
	client *container.Client,
	p position.Position,
	maxResults int32,
) (*SnapshotIterator, error)

func (*SnapshotIterator) HasNext

func (w *SnapshotIterator) HasNext(_ context.Context) bool

func (*SnapshotIterator) Next

func (*SnapshotIterator) Stop

func (w *SnapshotIterator) Stop()

Jump to

Keyboard shortcuts

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