Documentation
¶
Overview ¶
Package pagination provides utilities for handling pagination in HTTP requests.
Index ¶
Constants ¶
View Source
const ( // DefaultPage is the default page number when not specified. DefaultPage = 1 // DefaultPerPage is the default number of items per page. DefaultPerPage = 20 // MaxPerPage is the maximum allowed items per page. MaxPerPage = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Params ¶
Params contains pagination parameters extracted from an HTTP request.
func FromRequest ¶
FromRequest extracts pagination parameters from an HTTP request. It reads "page" and "per_page" query parameters and validates them.
func FromValues ¶
FromValues creates pagination params from explicit values. Useful for programmatic pagination without HTTP context.
Click to show internal directories.
Click to hide internal directories.