Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBaseURL ¶
BuildBaseURL constructs the full URL (scheme + host + path) from the request.
func Paginate ¶
func Paginate(total int, p PaginationParams, baseURL string, extra url.Values) (next *string, previous *string)
Paginate takes a total count, pagination params, base URL built from the request, and optional
func SlicePage ¶
func SlicePage(total int, p PaginationParams) (start, end int)
SlicePage returns the slice of items for the current page.
Types ¶
type PaginatedResponse ¶
type PaginatedResponse struct {
Count int `json:"count"`
Next *string `json:"next"`
Previous *string `json:"previous"`
Results interface{} `json:"results"`
}
PaginatedResponse represents a generic paginated API response.
type PaginationParams ¶
PaginationParams holds parsed limit and offset values.
func ParsePagination ¶
func ParsePagination(c echo.Context, defaultLimit int) PaginationParams
ParsePagination extracts limit and offset from query params with defaults.
Click to show internal directories.
Click to hide internal directories.