Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewOptions ¶ added in v2.1.0
type NewOptions struct { Collection string Context context.Context Database *mongo.Database FromToken string PageSize int64 UnmarshalInterface interface{} QueryTimeout time.Duration Request *http.Request }
NewOptions used to specify initialization options for a new PageMaster instance
type PageMaster ¶
type PageMaster struct {
// contains filtered or unexported fields
}
PageMaster is a pagination struct that scrolls through pages
func New ¶
func New(o *NewOptions) PageMaster
New instantiates a new PageMaster from passed in options
func (*PageMaster) Collection ¶
func (p *PageMaster) Collection() *mongo.Collection
Collection returns the collection associated with the PageMaster object
func (*PageMaster) Database ¶
func (p *PageMaster) Database() *mongo.Database
Database returns the database associated with the PageMaster object
func (*PageMaster) FindPaginated ¶
func (p *PageMaster) FindPaginated() ([]interface{}, error)
FindPaginated executes a mongodb query with the paginated items
func (*PageMaster) GetMongoDBQueryFilter ¶
func (p *PageMaster) GetMongoDBQueryFilter() bson.M
GetMongoDBQueryFilter creates pagination filters for mongo queries
func (*PageMaster) NextToken ¶
func (p *PageMaster) NextToken() string
NextToken is the string reprsentation of the next object
func (*PageMaster) PageSize ¶
func (p *PageMaster) PageSize() *int64
PageSize returns the page size of the paginated instance
Click to show internal directories.
Click to hide internal directories.