params

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PagingParam     = "paging"
	OrderByParam    = "orderBy"
	ConditionsParam = "conditions"
	ReverseParam    = "reverse"
)
View Source
const (
	DefaultLimit = 10
	DefaultPage  = 1
)

Variables

This section is empty.

Functions

func AtoiOrDefault

func AtoiOrDefault(str string, defVal int) int

func GetBoolValueWithDefault

func GetBoolValueWithDefault(req *restful.Request, name string, dv bool) bool

func GetStringValueWithDefault

func GetStringValueWithDefault(req *restful.Request, name string, dv string) string

func ParsePaging

func ParsePaging(req *restful.Request) (limit, offset int)

ParsePaging parse the paging parameters from the request, then returns the limit and offset supported format: ?limit=1&page=1 supported format: ?paging=limit=100,page=1

Types

type Conditions

type Conditions struct {
	Match map[string]string
	Fuzzy map[string]string
}

func ParseConditions

func ParseConditions(req *restful.Request) (*Conditions, error)

Jump to

Keyboard shortcuts

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