iterator

package
v0.2.0-nightly.20220209 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CDCIterator

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

CDCIterator scans the bucket periodically and detects changes made to it.

func NewCDCIterator

func NewCDCIterator(bucket string, pollingPeriod time.Duration, client *s3.Client, from time.Time) (*CDCIterator, error)

NewCDCIterator returns a CDCIterator and starts the process of listening to changes every pollingPeriod.

func (*CDCIterator) HasNext

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

HasNext returns a boolean that indicates whether the iterator has any objects in the buffer or not.

func (*CDCIterator) Next

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

Next returns the next record from the buffer.

func (*CDCIterator) Stop

func (w *CDCIterator) Stop()

type CacheEntry

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

type CombinedIterator

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

func NewCombinedIterator

func NewCombinedIterator(
	bucket string,
	pollingPeriod time.Duration,
	client *s3.Client,
	p position.Position,
) (*CombinedIterator, error)

func (*CombinedIterator) HasNext

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

func (*CombinedIterator) Next

func (*CombinedIterator) Stop

func (c *CombinedIterator) Stop()

type SnapshotIterator

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

SnapshotIterator to iterate through S3 objects in a specific bucket.

func NewSnapshotIterator

func NewSnapshotIterator(bucket string, client *s3.Client, p position.Position) (*SnapshotIterator, error)

NewSnapshotIterator takes the s3 bucket, the client, and the position. it returns an snapshotIterator starting from the position provided.

func (*SnapshotIterator) HasNext

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

HasNext returns a boolean that indicates whether the iterator has more objects to return or not.

func (*SnapshotIterator) Next

Next returns the next record in the iterator. returns an empty record and an error if anything wrong happened.

Jump to

Keyboard shortcuts

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