pagination

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Current  int         `json:"current" validate:"min=1"`  //当前页数, 默认值 1
	PageSize int         `json:"pageSize" validate:"min=1"` //每页条数, 默认值 10
	Total    int         `json:"total"`                     //数据总数
	Data     interface{} `json:"data"`                      //切片指针
}

func New

func New(current int, pageSize int, datas ...interface{}) *Pagination

func (*Pagination) Limit

func (p *Pagination) Limit() int64

func (*Pagination) Result

func (p *Pagination) Result() interface{}

func (*Pagination) SetTotal

func (p *Pagination) SetTotal(n int64)

func (*Pagination) Skip

func (p *Pagination) Skip() int64

Jump to

Keyboard shortcuts

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