Documentation ¶
Index ¶
Constants ¶
View Source
const PAGINATION_DEFAULT_LIMIT = 100
View Source
const PAGINATION_MAX_LIMIT = 1000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaginatedResponse ¶
type PaginatedResponse struct { Items []render.Renderer `json:"items"` TotalCount int `json:"total_count"` PageCount int `json:"page_count"` NextPageOffset int `json:"next_page_offset"` PreviousPageOffset int `json:"previous_page_offset"` }
func (*PaginatedResponse) Render ¶
func (logEntry *PaginatedResponse) Render(writer http.ResponseWriter, request *http.Request) error
type PaginationService ¶
func (PaginationService) ApplyQueryOffsetAndLimit ¶
func (service PaginationService) ApplyQueryOffsetAndLimit(query QueryOffsetAndLimit)
func (PaginationService) GetRequestOffsetAndLimit ¶
func (service PaginationService) GetRequestOffsetAndLimit() (int, int)
func (PaginationService) PreparePaginatedResponse ¶
func (service PaginationService) PreparePaginatedResponse(items []render.Renderer, totalCount int) PaginatedResponse
type PaginationServiceInterface ¶
type PaginationServiceInterface interface { GetRequestOffsetAndLimit() (int, int) ApplyQueryOffsetAndLimit(query QueryOffsetAndLimit) PreparePaginatedResponse(items []render.Renderer, totalCount int) PaginatedResponse }
Click to show internal directories.
Click to hide internal directories.