pager

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IPager

type IPager[T any] interface {
	Filter() *T
	Sorters() []Sorter

	String() string
}

IPager 分页参数

type Sorted

type Sorted uint8

Sorted 排序顺序

const (
	ASC    Sorted = iota // 正序
	DESC                 // 倒序
	Custom               // 自定义
)

func (Sorted) String

func (s Sorted) String() string

type Sorter

type Sorter struct {
	Field  string
	Sorted Sorted
}

Sorter 排序器

func ParseSorts

func ParseSorts(sort string) []Sorter

ParseSorts 解析排序规则 以符号开头,可选符号:(+或空 正序)(- 倒序)(* 自定义复杂排序标识关键词) 多个排序规则按英文逗号隔开

Jump to

Keyboard shortcuts

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