Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListFetcher ¶
type ListFetcher func(w http.ResponseWriter, r *http.Request, limit int, offset int) (list interface{}, totalCount int, err error)
ListFetcher is an interface for an endpoint that returns a list of values that we want to paginate
type Paginator ¶
func NewPaginator ¶
func (*Paginator) Paginate ¶
func (p *Paginator) Paginate(listFetcher ListFetcher) func(w http.ResponseWriter, r *http.Request)
Paginate wraps a http endpoint to return a paginated list from the list returned by the provided function
Click to show internal directories.
Click to hide internal directories.