Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPage = 1 DefaultSize = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pagination ¶
type Pagination[T any] struct { Items []*T `json:"items"` Page int `json:"page"` Size int `json:"size"` Total int `json:"total"` }
func (*Pagination[T]) GetOffset ¶
func (p *Pagination[T]) GetOffset() int
func (*Pagination[T]) GetPage ¶
func (p *Pagination[T]) GetPage() int
func (*Pagination[T]) GetSize ¶
func (p *Pagination[T]) GetSize() int
func (*Pagination[T]) Paginate ¶
func (p *Pagination[T]) Paginate(items []*T, total int) *Pagination[T]
Click to show internal directories.
Click to hide internal directories.