Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaginateOpts ¶
type PaginateOpts struct {
PageNumber int
AmountItems int
Query bson.M
SortOrder string
// QueryFunc is an optional parameter to override the default query builder function
// By default `document.WhereQuery` is used to build the query, implying that if the model
// includes `document.Paranoid`, soft-deleted documents won't be included in the results
// It only change the query builder function, the query itself is not modified (sort/amount/page)
QueryFunc QueryFunc
}
type Service ¶
type Service interface {
Paginate(ctx context.Context, collection string, result interface{}, opts PaginateOpts) (Meta, error)
}
func NewPaginationService ¶
func NewPaginationService(opts ServiceOpts) Service
type ServiceOpts ¶
func (ServiceOpts) Paginate ¶
func (s ServiceOpts) Paginate(ctx context.Context, collection string, result interface{}, opts PaginateOpts) (Meta, error)
Click to show internal directories.
Click to hide internal directories.