Documentation ¶
Index ¶
- type Paginate
- func (p Paginate) CanNext() bool
- func (p Paginate) CanPrev() bool
- func (p Paginate) Count() int64
- func (p Paginate) Items() int64
- func (p Paginate) Limit() int64
- func (p Paginate) LimitOffset() (limit, offset int64)
- func (p Paginate) MaxPage() int64
- func (p Paginate) Next() int64
- func (p Paginate) Offset() int64
- func (p Paginate) Page() int64
- func (p Paginate) Pages(around, edge int64) []int64
- func (p Paginate) PerPage() int64
- func (p Paginate) Prev() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Paginate ¶
type Paginate struct {
// contains filtered or unexported fields
}
Paginate type
func FromLimitOffset ¶
FromLimitOffset creates new paginate from limit, offset and count
func (Paginate) LimitOffset ¶
LimitOffset returns limit and offet
func (Paginate) Pages ¶
Pages returns page numbers for paginate
around is the number of page around the current page ex. if current page is 10 and around is 3 the result is 0 7 8 9 10 11 12 13 0
edge is the number of page at the edge ex. if current page is 10, max page is 20 and edge is 2 the result is 1 2 0 10 0 19 20
then if current page is 10, max page is 20, around is 3, and edge is 2 the result is 1 2 0 7 8 9 10 11 12 13 0 19 20
Click to show internal directories.
Click to hide internal directories.