queryparams

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 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 interface{}) *QueryParams

NewQueryParamsFromTag create QueryParams from struct

func (*QueryParams) GetFilters

func (p *QueryParams) GetFilters() map[string]interface{}

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 exprs

func (*QueryParams) SetFilter

func (p *QueryParams) SetFilter(name string, value interface{})

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 nolint:errcheck

Jump to

Keyboard shortcuts

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