pagex

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(p *Page)

func Count

func Count(count bool) Option

func CountColumn

func CountColumn(countColumn string) Option

func OrderBy

func OrderBy(orderBy string) Option

OrderBy 设置排序字段

func OrderByOnly added in v1.0.1

func OrderByOnly(orderByOnly bool) Option

func UnsafeOrderBy

func UnsafeOrderBy(orderBy string) Option

UnsafeOrderBy 不安全的设置排序方法,如果从前端接收参数,请自行做好注入校验。

type Page

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

func NewPage

func NewPage(pageNum uint64, pageSize uint64, opts ...Option) (*Page, error)

func (*Page) Count

func (p *Page) Count() bool

func (*Page) CountColumn

func (p *Page) CountColumn() string

func (*Page) Limit

func (p *Page) Limit() uint64

func (*Page) Offset

func (p *Page) Offset() uint64

func (*Page) OrderBy

func (p *Page) OrderBy() string

func (*Page) PageNum

func (p *Page) PageNum() uint64

func (*Page) PageSize

func (p *Page) PageSize() uint64

func (*Page) Pages

func (p *Page) Pages() uint64

func (*Page) SetTotal

func (p *Page) SetTotal(total uint64)

func (*Page) Total

func (p *Page) Total() uint64

Jump to

Keyboard shortcuts

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