args

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pager

type Pager struct {
	Page  int `form:"p"` // page no
	Limit int `form:"l"` // page limit
	Count int // page item count
	Total int // total count
}

func (*Pager) Begin

func (p *Pager) Begin() int

func (*Pager) End

func (p *Pager) End() int

func (*Pager) Normalize

func (p *Pager) Normalize(limits ...int)

func (*Pager) Pages

func (p *Pager) Pages() int

Pages return the pages according to the total, limit.

func (*Pager) Start

func (p *Pager) Start() int

type Query

type Query struct {
	Key string `form:"k"`
	Sorter
	Pager
}

func (*Query) Normalize

func (q *Query) Normalize(columns []string, limits []int)

type Sorter

type Sorter struct {
	Col string `form:"c"`
	Dir string `form:"d,lower"`
}

func (*Sorter) IsAsc added in v1.0.12

func (s *Sorter) IsAsc() bool

func (*Sorter) IsDesc added in v1.0.12

func (s *Sorter) IsDesc() bool

func (*Sorter) Normalize

func (s *Sorter) Normalize(columns ...string)

func (*Sorter) Order added in v1.0.12

func (s *Sorter) Order(quote ...string) string

Order return the sql order by string (quote + Col + quote + " " + Dir) the default quote string is ""

func (*Sorter) String

func (s *Sorter) String() string

String return Col + " " + Dir

Jump to

Keyboard shortcuts

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