Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pagination ¶
type Pagination paginations.Pagination
Pagination defines the query limits and offsets. It defines the maximum size (Limit) as well as an offset at which the query should start.
func New ¶
func New(a, b int, tp Type) *Pagination
New creates new pagination for the given query The arguments 'a' and 'b' means as follows: - 'limit' and 'offset' for the type 'TpLimitOffset' - 'pageSize' and 'pageNumber' for the type 'TpPage'
func NewLimitOffset ¶
func NewLimitOffset(limit, offset int) *Pagination
NewLimitOffset createw new limit, offset type pagination
func NewPaged ¶
func NewPaged(number, size int) *Pagination
NewPaged creates new paged type Pagination
func (*Pagination) Check ¶
func (p *Pagination) Check() error
Check checks if the pagination is well formed
func (*Pagination) FormatQuery ¶
func (p *Pagination) FormatQuery(q ...url.Values) url.Values
FormatQuery formats the pagination for the url query.
func (*Pagination) GetLimitOffset ¶
func (p *Pagination) GetLimitOffset() (int, int)
GetLimitOffset gets the limit and offset from the current pagination
func (*Pagination) String ¶
func (p *Pagination) String() string
String implements Stringer interface