Documentation ¶
Index ¶
- func GetLimit(c *gin.Context) int
- func GetPage(c *gin.Context) int
- func GetSize(c *gin.Context) int
- func Page(tx *gorm.DB, pageable Pageable) *gorm.DB
- func PageWithDefaultOrder(tx *gorm.DB, pageable Pageable, defaultOrders ...string) *gorm.DB
- func PageWithDefaultSort(tx *gorm.DB, pageable Pageable, defaultSorts ...Sort) *gorm.DB
- type Pageable
- type Pagination
- type Query
- func (p *Query) Infinite(pageable Pageable) *Query
- func (p *Query) InfiniteWithDefaultOrder(pageable Pageable, defaultOrders ...string) *Query
- func (p *Query) InfiniteWithDefaultSort(pageable Pageable, defaultSorts ...Sort) *Query
- func (p *Query) Page(pageable Pageable) *Query
- func (p *Query) PageWithDefaultOrders(pageable Pageable, defaultOrders ...string) *Query
- func (p *Query) PageWithDefaultSorts(pageable Pageable, defaultSorts ...Sort) *Query
- type Sort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PageWithDefaultOrder ¶
Types ¶
type Pageable ¶
type Pageable interface { GetPage() int GetSize() int GetSort() []Sort GetLimit() int GetOffset() int NoSort() bool }
func GetPageable ¶
type Pagination ¶
type Pagination struct { Total int64 `json:"total"` Page int `json:"page"` Size int `json:"size"` Sort []Sort `json:"sort"` }
func (*Pagination) GetLimit ¶
func (p *Pagination) GetLimit() int
func (*Pagination) GetOffset ¶
func (p *Pagination) GetOffset() (offset int)
func (*Pagination) GetPage ¶
func (p *Pagination) GetPage() int
func (*Pagination) GetSize ¶
func (p *Pagination) GetSize() int
func (*Pagination) GetSort ¶
func (p *Pagination) GetSort() []Sort
func (*Pagination) GetTotal ¶
func (p *Pagination) GetTotal() int64
func (*Pagination) NoSort ¶
func (p *Pagination) NoSort() bool
type Query ¶
type Query struct { *gorm.DB Pagination }
func (*Query) InfiniteWithDefaultOrder ¶
func (*Query) InfiniteWithDefaultSort ¶
func (*Query) PageWithDefaultOrders ¶
Click to show internal directories.
Click to hide internal directories.