Documentation
¶
Overview ¶
Package paging provides utilities to handle pagination.
The Paging struct represents the pagination information and is automatically populated by the New function.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Paging ¶
type Paging struct { // CurrentPage is the current page number starting from 1. CurrentPage uint `json:"page"` // PageSize is the maximum number of items that can be contained in a page. It is also the LIMIT in SQL queries. PageSize uint `json:"page_size"` // TotalItems is the total number of items to be paginated. TotalItems uint `json:"total_items"` // TotalPages is the total number of pages required to contain all the items. TotalPages uint `json:"total_pages"` // PreviousPage is the previous page. It is equal to 1 if we are on the first page (CurrentPage == 1). PreviousPage uint `json:"previous_page"` // NextPage is the next page. It is equal to TotalPages if we are on the last page (CurrentPage == TotalPages). NextPage uint `json:"next_page"` // Offset is the zero-based number of items before the current page. Offset uint `json:"offset"` }
Paging contains the paging information.
Click to show internal directories.
Click to hide internal directories.