Documentation
¶
Index ¶
- Constants
- Variables
- type Adapter
- type Paginator
- func (p Paginator) HasNext() bool
- func (p Paginator) HasPages() bool
- func (p Paginator) HasPrev() bool
- func (p Paginator) NextPage() (int, error)
- func (p *Paginator) Nums() int
- func (p Paginator) Page() int
- func (p Paginator) PageNums() int
- func (p Paginator) PrevPage() (int, error)
- func (p Paginator) Results(data interface{}) error
- func (p *Paginator) SetPage(page int)
Constants ¶
const DefaultMaxPerPage = 10
DefaultMaxPerPage default number of records per page
Variables ¶
var ErrNoNextPage = errors.New("no next page")
ErrNoNextPage current page is last page
var ErrNoPrevPage = errors.New("no previous page")
ErrNoPrevPage current page is first page
Functions ¶
This section is empty.
Types ¶
type Paginator ¶
type Paginator struct {
// contains filtered or unexported fields
}
Paginator structure
func (Paginator) NextPage ¶
NextPage returns next page number or ErrNoNextPage if current page is last page
func (Paginator) PrevPage ¶
PrevPage returns previous page number or ErrNoPrevPage if current page is first page