queryparams

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryParams

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

QueryParams for pagination

func NewQueryParams

func NewQueryParams() *QueryParams

NewQueryParams return a QueryParams

func NewQueryParamsFromTag

func NewQueryParamsFromTag(ptr any) *QueryParams

NewQueryParamsFromTag create QueryParams from struct

func (*QueryParams) GetFilters

func (p *QueryParams) GetFilters() map[string]any

GetFilters return the filters map

func (*QueryParams) Limit

func (p *QueryParams) Limit() int

Limit return the sql limit

func (*QueryParams) Offset

func (p *QueryParams) Offset() int

Offset return the sql offset

func (*QueryParams) OrderBy

func (p *QueryParams) OrderBy() []string

OrderBy return the order by expression

func (*QueryParams) SetFilter

func (p *QueryParams) SetFilter(name string, value any)

SetFilter add a filter condition

func (*QueryParams) SetOrderBy

func (p *QueryParams) SetOrderBy(orderBy []string)

SetOrderBy set the order by condition

func (*QueryParams) SetPagination

func (p *QueryParams) SetPagination(page, perPage int)

SetPagination set the pagination info

func (*QueryParams) String

func (p *QueryParams) String() string

String return the string representation

Jump to

Keyboard shortcuts

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