Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrorSeparator = "; " FieldSeparator = " : " )
Delimiters for text representation of errors.
Variables ¶
View Source
var ( // ErrNotFound is returned when data not found by identifier. ErrNotFound = errors.New("not found") // ErrDuplicateKey is returned when got duplicate key error from database. ErrDuplicateKey = errors.New("duplicate key") // ErrRequiredFieldMissed is returned when required param is empty in the request. ErrRequiredFieldMissed = errors.New("is required") )
Functions ¶
This section is empty.
Types ¶
type ValidationError ¶
ValidationError contains field name and error message.
func NewValidationError ¶
func NewValidationError(field, msg string) *ValidationError
NewValidationError creates and returns pointer to ValidationError.
func (*ValidationError) Error ¶
func (ve *ValidationError) Error() string
Error represents an error condition, with the nil value representing no error.
type ValidationErrors ¶
type ValidationErrors []ValidationError
ValidationErrors is an array of ValidationError's for use in custom error messages post validation.
func (ValidationErrors) Error ¶
func (ves ValidationErrors) Error() string
Error represents an error condition, with the nil value representing no error.
Click to show internal directories.
Click to hide internal directories.