Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(rw http.ResponseWriter, err string, code int)
Error is a simplified JSONError wrapper that accepts a string error
func JSONError ¶
func JSONError(w http.ResponseWriter, err interface{}, code int)
JSONError writes the given object as an error with the given code to the response writer
func Unauthorized ¶
func Unauthorized(rw http.ResponseWriter)
Unauthorized writes a unauthorized JSONError to the response writer
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { // The error Error string `json:"error"` }
ErrorResponse is a generic response containing an error
type ValidationError ¶
type ValidationError struct {
// The missing requirements
Errors interface{} `json:"validationErrors"`
}
ValidationError shows the failed validation requirements. Each form property that has missing requirements is listet under Errors (validationErrors)
func (*ValidationError) Error ¶
func (myErr *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.