Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmpty ¶
func IsEmpty(s interface{}) bool
IsEmpty returns true if the given interface is empty, false otherwise
Types ¶
type Error ¶
type Error struct { FieldName string FieldValue interface{} // contains filtered or unexported fields }
Error represents a validation error
func InvalidEmail ¶
InvalidEmail returns an invalid validation error for the given field name and value
func InvalidEmpty ¶
InvalidEmpty returns an empty validation Error for the given field name
func InvalidURL ¶
InvalidURL returns an invalid validation error for the given field name and value
func (*Error) MsgForCode ¶
MsgForCode returns a human readable message for the given ErrorKind. The message may optionally include the given field value in the message.
type ErrorKind ¶
type ErrorKind int
ErrorKind represents a validation error type
const ( // ErrorGeneral represents a catchall validation error. That is, // an error that does not match any ErrorKind. ErrorGeneral ErrorKind = iota // ErrorEmpty represents an empty field validation error. ErrorEmpty // ErrorInvalidEmail represents an invalid email validation error. ErrorInvalidEmail // ErrorInvalidURL represents an invalid url validation error. ErrorInvalidURL )
ErrorKind enumeration
Click to show internal directories.
Click to hide internal directories.