Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrIteratorFinished = errors.New("iterator has reached end")
ErrIteratorFinished indicates that Next was called on a finished iterator
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity interface{}
Entity is a generic type which can be operated on by Iterator and Writer
type FetchFn ¶
FetchFn fetches Page from PageToken. Once a page with nil NextToken is returned no more pages will be fetched.
type Iterator ¶
Iterator is used to get entities from a collection of pages. When HasNext returns true it is guaranteed that Next will not return an error. Once iterator returns an error it will never make progress again and will always return that same error. Iterator is not thread safe and does not make defensive in or out copies.
func NewIterator ¶
NewIterator constructs a new Iterator
type Page ¶
Page contains a PageToken which identifies the current page, a PageToken which identifies the next page and a list of Entity.
type ShouldFlushFn ¶
ShouldFlushFn returns true if given page should be flushed false otherwise.
type WriteFn ¶
WriteFn writes given Page to underlying sink. The Pages's NextToken will always be nil, its the responsibility of WriteFn to construct and return the next PageToken, or return an error on failure.