pagination

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PageJson

type PageJson map[string]int

将page对象按照json的格式输出 @author fuzeyu

type Pagination

type Pagination struct {
	// contains filtered or unexported fields
}

redis分页工具

func NewPagination

func NewPagination(total int, pageIndex int, pageSize ...int) *Pagination

获取redis分页对象 @param total 总页数 @param pageIndex 当前页数 @param pageSize 页码长度

func (*Pagination) Json

func (this *Pagination) Json() PageJson

将分页信息转换成json字符串 @param path 当前请求连接,不包含page字段

func (*Pagination) Limit

func (this *Pagination) Limit() int

获取查询数据库分页限制记录

func (*Pagination) Offset

func (this *Pagination) Offset() int

获取查询数据库分页起始记录

func (*Pagination) PageIndex

func (this *Pagination) PageIndex() int

获取当前页码

func (*Pagination) PageSize

func (this *Pagination) PageSize() int

获取分页步长

func (*Pagination) Total

func (this *Pagination) Total() int

获取总条数

func (*Pagination) TotalPage

func (this *Pagination) TotalPage() int

获取总页数

Jump to

Keyboard shortcuts

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