Documentation ¶
Overview ¶
Package rest provides utilities shared across the gateway and scheduler adapters to build REST APIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorInternal ¶
func ErrorInternal(res http.ResponseWriter, req *http.Request)
ErrorInternal handles HTTP 500 error responses. When called, the calling function must return to avoid writing several times on the HTTP response writer.
func ErrorNotFound ¶
func ErrorNotFound(res http.ResponseWriter, req *http.Request)
ErrorNotFound handles HTTP 404 error responses. When called, the calling function must return to avoid writing several times on the HTTP response writer.
Types ¶
type Pagination ¶ added in v0.14.0
type Pagination struct { // Current is the current page. Current uint16 `json:"current"` // Previous is the previous page. It will be nil if there is no previous page. Previous *uint16 `json:"previous"` // Next is the next page. It will be nil if there is no next page. Next *uint16 `json:"next"` // First is the first page. It will always be 1. First uint16 `json:"first"` // Last is the last page. Last uint16 `json:"last"` }
Pagination holds the pagination details when looking for entries in the REST API.
Click to show internal directories.
Click to hide internal directories.