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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SheetsIterator

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

func NewSheetsIterator

func NewSheetsIterator(ctx context.Context,
	tp position.SheetPosition,
	args sheets.BatchReaderArgs,
) (*SheetsIterator, error)

NewSheetsIterator creates a new instance of sheets iterator and starts polling google sheets api for new changes using the row offset of last successful row read in a separate go routine, row offset is received in sheet position

func (*SheetsIterator) HasNext

func (c *SheetsIterator) HasNext() bool

HasNext returns whether there are any more records to be returned

func (*SheetsIterator) Next

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

Next returns the next record in buffer and error in case there are no more records and there was an error leading to tomb dying or context was cancelled

func (*SheetsIterator) Stop

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

Stop the go routines and ticker

Jump to

Keyboard shortcuts

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