Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaginatedResponse ¶
type PaginatedResponse struct { Pagination PaginationInfo `json:"pagination"` Data json.RawMessage `json:"data"` }
PaginatedResponse is a response that contains pagination information.
func NewEmptyPaginatedResponse ¶
func NewEmptyPaginatedResponse() PaginatedResponse
NewEmptyPaginatedResponse returns a PaginatedResponse with an empty data and 0 pages.
This is useful for returning an empty list.
func NewPaginatedResponse ¶
func NewPaginatedResponse(r *http.Request, data interface{}, currentPage, pageLimit, totalItems int) (PaginatedResponse, error)
NewPaginatedResponse returns a PaginatedResponse with pagination information.
Click to show internal directories.
Click to hide internal directories.