Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyOrWhitespaceOnlyRE = regexp.MustCompile(`^\s*$`)
EmptyOrWhitespaceOnlyRE is a regex that checks for blank or whitespace only strings
Functions ¶
func NewError ¶
func NewError(violations []*FieldViolation) error
NewError creates new validation error for field violoations.
func NewPlainError ¶
func NewPlainError(fv *FieldViolation) error
NewPlainError creates new validation error.
Types ¶
type FieldViolation ¶
FieldViolation represents custom bad request error field violation error option.
func RequiredField ¶
func RequiredField(field, fieldName, resourceName string) *FieldViolation
RequiredField verifies that the given field is not empty
Click to show internal directories.
Click to hide internal directories.