Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOffsetFromParams ¶
func CreateOffsetFromParams(paginateParams PaginateParams) int
CreateOffsetFromParams creates an offset from the given PaginateParams.
Types ¶
type PaginateParams ¶
type PaginateParams struct { Limit int `query:"limit" form:"limit" json:"limit"` Page int `query:"page" form:"page" json:"page"` }
PaginateParams are the parameters for a paginated request.
type PaginateResponse ¶
type PaginateResponse struct { TotalItems int `json:"total_items"` TotalPages int `json:"total_pages"` ItemsPerPage int `json:"items_per_page"` PreviousPage int `json:"previous_page"` HasPreviousPage bool `json:"has_previous_page"` CurrentPage int `json:"current_page"` NextPage int `json:"next_page"` HasNextPage bool `json:"has_next_page"` }
PaginateResponse is the response for a paginated request.
func CreatePaginateResponse ¶
func CreatePaginateResponse( paginateParams PaginateParams, totalItems int, ) PaginateResponse
CreatePaginateResponse creates a PaginateResponse from the given parameters.
Click to show internal directories.
Click to hide internal directories.