pagination

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetPaginator

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

OffsetPaginator 基于 Offset 的分页器

func NewOffsetPaginator

func NewOffsetPaginator() *OffsetPaginator

func (*OffsetPaginator) BuildDB

func (p *OffsetPaginator) BuildDB(offset, limit int) func(*gorm.DB) *gorm.DB

BuildDB 根据传入的 offset/limit 更新内部状态并返回用于 GORM 的函数 使用方式示例: db = paginator.BuildDB(offset, limit)(db)

type PagePaginator

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

PagePaginator 基于页码的分页器

func NewPagePaginator

func NewPagePaginator() *PagePaginator

func (*PagePaginator) BuildDB

func (p *PagePaginator) BuildDB(page, size int) func(*gorm.DB) *gorm.DB

BuildDB 根据传入的 page/size 更新内部状态并返回用于 GORM 的函数 使用示例: db = paginator.BuildDB(page, size)(db)

type TokenPaginator

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

TokenPaginator 基于 Token 的分页器

func NewTokenPaginator

func NewTokenPaginator() *TokenPaginator

func (*TokenPaginator) BuildDB

func (p *TokenPaginator) BuildDB(token string, pageSize int) func(*gorm.DB) *gorm.DB

BuildDB 根据传入 token/size 更新状态并返回应用到 *gorm.DB 的闭包 使用示例: db = paginator.BuildDB(token, size)(db)

Jump to

Keyboard shortcuts

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