Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CannotBeBlank indicates a field that was submitted blank, but is required CannotBeBlank = "cannot-be-blank" // ValidationError indicates that a validation rule such as min / max value was violated ValidationError = "validation-error" )
View Source
const ( // MethodNotAllowed indicates that the attempted VERB is not implemented for that endpoint MethodNotAllowed = "method-not-allowed" // MalformedURL indicates that the URL was not parsable as input MalformedURL = "malformed-url" // InvalidRoute indicates that the route does not exist InvalidRoute = "invalid-route" // AuthenticationFailed indicates that authentication did not complete successfully AuthenticationFailed = "authentication-failed" // NotAuthorized indicates that the currently authenticated user is not permitted to perform an action NotAuthorized = "not-authorized" // SystemError indicates that a systemic issue has occurred with the request SystemError = "system-error" // NotFound indicates that the requested resource was not found NotFound = "not-found" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldError ¶
type FieldError struct { Code string `json:"code"` Message string `json:"message"` Field string `json:"field"` }
FieldError represents a validation error related to a specific input field
func NewFieldError ¶
func NewFieldError(code, message, field string) *FieldError
NewFieldError instantiates a FieldError
type RestError ¶
type RestError struct { Code string `json:"code"` Message string `json:"message"` Details []interface{} `json:"details"` }
RestError represents the standard error returned by the API Gateway
func NewRestError ¶
NewRestError instantiates a RestError
Click to show internal directories.
Click to hide internal directories.