Documentation
¶
Index ¶
Constants ¶
View Source
const DEFAULT_ITEMS = 20
Defines the default amount of returned items within an array
View Source
const MAX_ITEMS = 100
Defines maximal amount of returned items within an array
View Source
const MIN_ITEMS = 10
Defines the default amount of returned items within an array
Variables ¶
View Source
var PW_LETTERS = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!§$%&/()=?`*'_:;<>,.-")
Functions ¶
func ProcessPaginationInput ¶
ProcessPaginationInput parses the user input for limit and page query parameters
Types ¶
type ErrorResponse ¶
type HandlerParams ¶
type HandlerParams struct {
DbAccessor db.PostgresConnector
Ctx context.Context
Request events.APIGatewayProxyRequest
}
type Links ¶
type Pagination ¶
type Pagination struct {
Total int `json:"total"`
PerPage int `json:"per_page"`
CurrentPage int `json:"current_page"`
LastPage int `json:"last_page"`
From int `json:"from"`
To int `json:"to"`
Links Links `json:"_links"`
}
func GeneratePagination ¶
func GeneratePagination(total int, per_page int, page int, items int) Pagination
GeneratePagination generates the pagination struct calculated by the input
Click to show internal directories.
Click to hide internal directories.