pagination

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Size int64 `json:"size"` // Page Size, default 100
	Numb int64 `json:"numb"` // Page Numb, From One
}

func NewPage

func NewPage(size int, numb int) *Page

func PageAll

func PageAll() *Page

func PageNormal

func PageNormal() *Page

type Pagination

type Pagination[T any] struct {
	Paging *Paging `json:"paging"`
	Data   []*T    `json:"data"`
}

func NewPagination

func NewPagination[T any](paging *Paging, data []*T) *Pagination[T]

func (*Pagination[T]) Iter

func (p *Pagination[T]) Iter(fn func(item *T, idx int))

type Paging

type Paging struct {
	Size  int64 `json:"size"`  // Page Size, default 100
	Numb  int64 `json:"numb"`  // Page Numb, From One
	Total int64 `json:"total"` // Page Total, The Page Total
	Count int64 `json:"count"` // Item Count, The Item Count
}

func NewPaging

func NewPaging(size int64, current int64) *Paging

func PagingAll

func PagingAll() *Paging

func PagingOfPage

func PagingOfPage(page *Page) *Paging

func (*Paging) Limit

func (paging *Paging) Limit() int64

func (*Paging) Skip

func (paging *Paging) Skip() int64

func (*Paging) ToString

func (paging *Paging) ToString() string

func (*Paging) WithCount

func (paging *Paging) WithCount(count int64) *Paging

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL