common

package module
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultPaginatorParamsParser

func NewDefaultPaginatorParamsParser() *defaultPaginatorParamsParser

func NewPaginatorParamsParser

func NewPaginatorParamsParser(limitParam, offsetParam, orderByParam, prevPageValuesParam string,
	orderByParse OrderByParseFunc, prevPageValuesParse PrevPageValuesParseFunc) *defaultPaginatorParamsParser

Types

type OrderByParam

type OrderByParam struct {
	Field string
	Order string
}

type OrderByParams

type OrderByParams = []*OrderByParam

func DefaultOrderByParse

func DefaultOrderByParse(params QueryParams, orderByParam string) (orderByParams OrderByParams, err error)

type OrderByParseFunc

type OrderByParseFunc = func(params QueryParams, orderByParam string) (orderByParams OrderByParams, err error)

type PaginatorParams

type PaginatorParams struct {
	Limit    int
	Offset   int
	OrderBy  OrderByParams
	PrevPage PrevPageValues
}

type PaginatorParamsParser

type PaginatorParamsParser interface {
	ParseQuery(query string) (params PaginatorParams, err error)
}

type PrevPageValues

type PrevPageValues = map[string]interface{}

func DefaultPrevPageValuesParse

func DefaultPrevPageValuesParse(params QueryParams, prevPageValueParam string) (prevPageValues PrevPageValues, err error)

type PrevPageValuesParseFunc

type PrevPageValuesParseFunc = func(params QueryParams, prevPageValueParam string) (prevPageValues PrevPageValues, err error)

type QueryParams

type QueryParams = map[string][]string

Jump to

Keyboard shortcuts

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