iterator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 9 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 *azblob.ContainerClient,
	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) (sdk.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 *azblob.ContainerClient,
	maxResults int32,
	p position.Position,
) (c *CombinedIterator, err error)

func (*CombinedIterator) HasNext

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

func (*CombinedIterator) Next

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

func (*CombinedIterator) Stop

func (c *CombinedIterator) Stop()

type Iterator

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

	// Next returns new sdk.Record while reading the container or error when operation failed
	Next(ctx context.Context) (sdk.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 *azblob.ContainerClient,
	p position.Position,
	maxResults int32,
) (*SnapshotIterator, error)

func (*SnapshotIterator) HasNext

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

func (*SnapshotIterator) Next

func (w *SnapshotIterator) Next(ctx context.Context) (sdk.Record, error)

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