args

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 3 Imported by: 3

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 `json:"p,omitempty" form:"p"` // page no
	Limit int `json:"l,omitempty" form:"l"` // page limit
	Count int `json:"-"`                    // page item count
	Total int `json:"-"`                    // 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 `json:"c,omitempty" form:"c"`
	Dir string `json:"d,omitempty" form:"d,lower"`
}

func (*Sorter) IsAsc

func (s *Sorter) IsAsc() bool

func (*Sorter) IsDesc

func (s *Sorter) IsDesc() bool

func (*Sorter) Normalize

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

func (*Sorter) Order

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