Documentation ¶
Overview ¶
Package pagination is a generated GoMock package.
Index ¶
- Variables
- type Entity
- type FetchFn
- type Iterator
- type MockEntity
- type MockEntityMockRecorder
- type MockIterator
- type MockIteratorMockRecorder
- type MockPageToken
- type MockPageTokenMockRecorder
- type MockWriter
- func (m *MockWriter) Add(arg0 Entity) error
- func (m *MockWriter) EXPECT() *MockWriterMockRecorder
- func (m *MockWriter) FirstFlushedPage() PageToken
- func (m *MockWriter) Flush() error
- func (m *MockWriter) FlushIfNotEmpty() error
- func (m *MockWriter) FlushedPages() []PageToken
- func (m *MockWriter) LastFlushedPage() PageToken
- type MockWriterMockRecorder
- func (mr *MockWriterMockRecorder) Add(arg0 interface{}) *gomock.Call
- func (mr *MockWriterMockRecorder) FirstFlushedPage() *gomock.Call
- func (mr *MockWriterMockRecorder) Flush() *gomock.Call
- func (mr *MockWriterMockRecorder) FlushIfNotEmpty() *gomock.Call
- func (mr *MockWriterMockRecorder) FlushedPages() *gomock.Call
- func (mr *MockWriterMockRecorder) LastFlushedPage() *gomock.Call
- type Page
- type PageToken
- type ShouldFlushFn
- type WriteFn
- type Writer
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.
type MockEntity ¶ added in v0.15.0
type MockEntity struct {
// contains filtered or unexported fields
}
MockEntity is a mock of Entity interface
func NewMockEntity ¶ added in v0.15.0
func NewMockEntity(ctrl *gomock.Controller) *MockEntity
NewMockEntity creates a new mock instance
func (*MockEntity) EXPECT ¶ added in v0.15.0
func (m *MockEntity) EXPECT() *MockEntityMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockEntityMockRecorder ¶ added in v0.15.0
type MockEntityMockRecorder struct {
// contains filtered or unexported fields
}
MockEntityMockRecorder is the mock recorder for MockEntity
type MockIterator ¶ added in v0.15.0
type MockIterator struct {
// contains filtered or unexported fields
}
MockIterator is a mock of Iterator interface
func NewMockIterator ¶ added in v0.15.0
func NewMockIterator(ctrl *gomock.Controller) *MockIterator
NewMockIterator creates a new mock instance
func (*MockIterator) EXPECT ¶ added in v0.15.0
func (m *MockIterator) EXPECT() *MockIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockIterator) HasNext ¶ added in v0.15.0
func (m *MockIterator) HasNext() bool
HasNext mocks base method
func (*MockIterator) Next ¶ added in v0.15.0
func (m *MockIterator) Next() (Entity, error)
Next mocks base method
type MockIteratorMockRecorder ¶ added in v0.15.0
type MockIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockIteratorMockRecorder is the mock recorder for MockIterator
func (*MockIteratorMockRecorder) HasNext ¶ added in v0.15.0
func (mr *MockIteratorMockRecorder) HasNext() *gomock.Call
HasNext indicates an expected call of HasNext
func (*MockIteratorMockRecorder) Next ¶ added in v0.15.0
func (mr *MockIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
type MockPageToken ¶ added in v0.15.0
type MockPageToken struct {
// contains filtered or unexported fields
}
MockPageToken is a mock of PageToken interface
func NewMockPageToken ¶ added in v0.15.0
func NewMockPageToken(ctrl *gomock.Controller) *MockPageToken
NewMockPageToken creates a new mock instance
func (*MockPageToken) EXPECT ¶ added in v0.15.0
func (m *MockPageToken) EXPECT() *MockPageTokenMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockPageTokenMockRecorder ¶ added in v0.15.0
type MockPageTokenMockRecorder struct {
// contains filtered or unexported fields
}
MockPageTokenMockRecorder is the mock recorder for MockPageToken
type MockWriter ¶ added in v0.15.0
type MockWriter struct {
// contains filtered or unexported fields
}
MockWriter is a mock of Writer interface
func NewMockWriter ¶ added in v0.15.0
func NewMockWriter(ctrl *gomock.Controller) *MockWriter
NewMockWriter creates a new mock instance
func (*MockWriter) Add ¶ added in v0.15.0
func (m *MockWriter) Add(arg0 Entity) error
Add mocks base method
func (*MockWriter) EXPECT ¶ added in v0.15.0
func (m *MockWriter) EXPECT() *MockWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockWriter) FirstFlushedPage ¶ added in v0.15.0
func (m *MockWriter) FirstFlushedPage() PageToken
FirstFlushedPage mocks base method
func (*MockWriter) Flush ¶ added in v0.15.0
func (m *MockWriter) Flush() error
Flush mocks base method
func (*MockWriter) FlushIfNotEmpty ¶ added in v0.15.0
func (m *MockWriter) FlushIfNotEmpty() error
FlushIfNotEmpty mocks base method
func (*MockWriter) FlushedPages ¶ added in v0.15.0
func (m *MockWriter) FlushedPages() []PageToken
FlushedPages mocks base method
func (*MockWriter) LastFlushedPage ¶ added in v0.15.0
func (m *MockWriter) LastFlushedPage() PageToken
LastFlushedPage mocks base method
type MockWriterMockRecorder ¶ added in v0.15.0
type MockWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockWriterMockRecorder is the mock recorder for MockWriter
func (*MockWriterMockRecorder) Add ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) Add(arg0 interface{}) *gomock.Call
Add indicates an expected call of Add
func (*MockWriterMockRecorder) FirstFlushedPage ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) FirstFlushedPage() *gomock.Call
FirstFlushedPage indicates an expected call of FirstFlushedPage
func (*MockWriterMockRecorder) Flush ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) Flush() *gomock.Call
Flush indicates an expected call of Flush
func (*MockWriterMockRecorder) FlushIfNotEmpty ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) FlushIfNotEmpty() *gomock.Call
FlushIfNotEmpty indicates an expected call of FlushIfNotEmpty
func (*MockWriterMockRecorder) FlushedPages ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) FlushedPages() *gomock.Call
FlushedPages indicates an expected call of FlushedPages
func (*MockWriterMockRecorder) LastFlushedPage ¶ added in v0.15.0
func (mr *MockWriterMockRecorder) LastFlushedPage() *gomock.Call
LastFlushedPage indicates an expected call of LastFlushedPage
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.