pager

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter map[string]interface{}

Filter 过滤器

type Option

type Option struct {
	Start   int
	Limit   int
	Filter  Filter
	Sorters []Sorter

	Preloads []string
}

Option 分页参数

func (Option) GetLimit

func (po Option) GetLimit() int

func (Option) GetPreloads added in v1.2.0

func (po Option) GetPreloads() []string

func (Option) GetSorters added in v1.2.0

func (po Option) GetSorters() []Sorter

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 added in v1.1.1

func ParseSorts(sort string) []Sorter

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

Jump to

Keyboard shortcuts

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