Documentation
¶
Overview ¶
Package response provides Response type for use with APIs that conform http://jsonapi.org specification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is JSON:API response error.
func (Error) WithStatus ¶
WithStatus returns error with the HTTP status code applicable to the problem.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response is JSON:API response.
func InternalServerError ¶
func InternalServerError() Response
InternalServerError returns 500 Internal Server Error response.
func (Response) MustWrite ¶
func (r Response) MustWrite(w http.ResponseWriter)
MustWrite writes the response to w or panics if any error occurs.
func (Response) WithStatus ¶
WithStatus returns response with the specific status code.