Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultPageSize is a default size for the pagination DefaultPageSize = uint32(20) // MinPageSize is a minimal page size for the pagination MinPageSize = uint32(5) // MinPageSize is a maximal page size for the pagination MaxPageSize = uint32(100) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct { // Number is the page number that starts with 1 Number, Size uint32 }
Page contains all the pagination parameters
func NormalizePagination ¶
NormalizePagination returns a struct with normalized pagination parameters
func NormalizePaginationWithValues ¶ added in v2.2.0
func NormalizePaginationWithValues(pageNumber, pageSize string, defaultPageSize, minPageSize, maxPageSize uint32) Page
NormalizePaginationWithValues returns a struct with normalized pagination parameters according to the settings
type Resolver ¶
type Resolver interface { // Resolve takes the HTTP request and resolves a parameters value by the given name Resolve(*http.Request, string) string }
Resolver is able to resolve a parameter value by name
func NewChiResolver ¶
func NewChiResolver() Resolver
NewChiResolver returns a parameter resolves that uses chi-based resolver
Click to show internal directories.
Click to hide internal directories.