iterator

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MetadataContentType = "gcs.contentType"
)

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(ctx context.Context, bucket string, pollingPeriod time.Duration, client *storage.Client, from time.Time, fromKey string) (*CDCIterator, error)

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

func (*CDCIterator) Next

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

Next returns the next record from the buffer.

func (*CDCIterator) Stop

func (w *CDCIterator) Stop(ctx context.Context)

type CacheEntry

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

type CombinedIterator

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

func NewCombinedIterator

func NewCombinedIterator(ctx context.Context, bucket string, pollingPeriod time.Duration, client *storage.Client, p position.Position) (*CombinedIterator, error)

func (*CombinedIterator) Next

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

func (*CombinedIterator) Stop

func (c *CombinedIterator) Stop(ctx context.Context)

type SnapshotIterator

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

SnapshotIterator to iterate through GoogleCloudStorage objects in a specific bucket.

func NewSnapshotIterator

func NewSnapshotIterator(ctx context.Context, bucket string, client *storage.Client, p position.Position) (*SnapshotIterator, error)

NewSnapshotIterator takes the GoogleCloudStorage bucket, the client, and the position. it returns a snapshotIterator starting from the position provided.

func (*SnapshotIterator) HasNext

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

func (*SnapshotIterator) Next

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

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

func (*SnapshotIterator) Stop

func (s *SnapshotIterator) Stop()

Jump to

Keyboard shortcuts

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