Documentation
¶
Index ¶
- func CheckPagination(p *Pagination) error
- type Pagination
- func (p *Pagination) Check() error
- func (p *Pagination) GetLimitOffset() (limit, offset int)
- func (p *Pagination) GetNumberSize() (pageNumber, pageSize int)
- func (p *Pagination) IsZero() bool
- func (p *Pagination) SetLimitOffset()
- func (p *Pagination) SetType(tp Type)
- func (p *Pagination) SetValue(val int, parameter Parameter)
- func (p *Pagination) String() string
- func (p *Pagination) Type() Type
- type Parameter
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPagination ¶
func CheckPagination(p *Pagination) error
CheckPagination checks if the given pagination is valid
Types ¶
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
Pagination is a struct that keeps variables used to paginate the result
func NewFromConfig ¶
func NewFromConfig(p *config.Pagination) *Pagination
NewFromConfig creates new pagination based on the provided config
func NewLimitOffset ¶ added in v0.1.5
func NewLimitOffset(limit, offset int) *Pagination
NewLimitOffset creates new limit offset pagination
func NewPaged ¶ added in v0.1.5
func NewPaged(pageNumber, pageSize int) *Pagination
NewPaged creates new pagination of TpPage type
func (*Pagination) Check ¶
func (p *Pagination) Check() error
Check checks if the given pagination is valid
func (*Pagination) GetLimitOffset ¶
func (p *Pagination) GetLimitOffset() (limit, offset int)
GetLimitOffset gets the limit and offset values from the given pagination
func (*Pagination) GetNumberSize ¶ added in v0.1.5
func (p *Pagination) GetNumberSize() (pageNumber, pageSize int)
GetNumberSize gets the page number and size
func (*Pagination) IsZero ¶ added in v0.1.5
func (p *Pagination) IsZero() bool
IsZero checks if the pagination were already set
func (*Pagination) SetLimitOffset ¶ added in v0.1.5
func (p *Pagination) SetLimitOffset()
SetLimitOffset sets the Pagination from the PageType into OffsetType
func (*Pagination) SetValue ¶ added in v0.1.5
func (p *Pagination) SetValue(val int, parameter Parameter)
SetValue sets the pagination value for given parameter
func (*Pagination) String ¶
func (p *Pagination) String() string
String implements Stringer interface