Documentation ¶
Index ¶
- func DecodeJSON(r io.Reader, v interface{}) error
- func Err(w http.ResponseWriter, status int, opts ...ErrOption)
- func ErrInternal(w http.ResponseWriter, err error)
- func ErrInternalWithRequestID(w http.ResponseWriter, id string, err error)
- func ErrInvalidRequest(w http.ResponseWriter, err error)
- func ErrInvalidRequestWithRequestID(w http.ResponseWriter, id string, err error)
- func ErrNotFound(w http.ResponseWriter)
- func ErrResourceNotFound(w http.ResponseWriter, resource string)
- func ErrUnauthorized(w http.ResponseWriter)
- func ErrUnauthorizedWithRequestID(w http.ResponseWriter, id string)
- func JSON(w http.ResponseWriter, status int, v interface{})
- func NoContent(w http.ResponseWriter)
- type ErrOption
- type ErrResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
func ErrInternal ¶
func ErrInternal(w http.ResponseWriter, err error)
func ErrInternalWithRequestID ¶
func ErrInternalWithRequestID(w http.ResponseWriter, id string, err error)
func ErrInvalidRequest ¶
func ErrInvalidRequest(w http.ResponseWriter, err error)
func ErrInvalidRequestWithRequestID ¶
func ErrInvalidRequestWithRequestID(w http.ResponseWriter, id string, err error)
func ErrNotFound ¶
func ErrNotFound(w http.ResponseWriter)
func ErrResourceNotFound ¶
func ErrResourceNotFound(w http.ResponseWriter, resource string)
func ErrUnauthorized ¶
func ErrUnauthorized(w http.ResponseWriter)
func ErrUnauthorizedWithRequestID ¶
func ErrUnauthorizedWithRequestID(w http.ResponseWriter, id string)
func JSON ¶
func JSON(w http.ResponseWriter, status int, v interface{})
JSON writes an http response using the value passed in v as JSON. If it cannot convert the value to JSON, it returns an error
func NoContent ¶
func NoContent(w http.ResponseWriter)
Types ¶
type ErrResponse ¶
Click to show internal directories.
Click to hide internal directories.