Documentation ¶
Index ¶
- Variables
- func InvalidFormatError(name string) error
- func MustBase64EncodedError(name string) error
- func MustBeSpecifiedError(name string) error
- func MustSpecifiedOneOfError(values ...string) error
- func MutuallyExclusiveError(n1, n2 string) error
- func RequireBetweenValuesError(n, leftInclusive, rightExclusive string) error
- func RequireGreaterThanError(n, oth string) error
- func RequireGreaterThanOrEqualError(n, oth string) error
- func RequireLessThanError(n, oth string) error
- func RequireLessThanOrEqualError(n, oth string) error
- func UnsupportedValueError(name string, unsupported interface{}, supported []interface{}) error
- type CumulatedErrors
- type Errors
- func (e Errors) Add(err error)
- func (e Errors) AddForProperty(prop string, err error)
- func (e Errors) Empty() bool
- func (e Errors) Error() string
- func (e Errors) ErrorOrNil() error
- func (e Errors) FinalAdd(err error) Errors
- func (e Errors) FinalAddForProperty(prop string, err error) Errors
- func (e Errors) Get(prop string) []error
- func (e Errors) MarshalJSON() ([]byte, error)
- func (e Errors) Merge(oth Errors)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIsRequired = errors.New("is required") ErrMustBeValidDate = errors.New("must be a RFC3339 date") ErrMustBePositive = errors.New("must be positive") ErrMustBePositiveOrZero = errors.New("must be positive or zero") ErrMustBeNegative = errors.New("must be negative") ErrMustBeNegativeOrZero = errors.New("must be negative or zero") ErrIsNotValid = errors.New("is not a valid value") ErrIsNotValidNumber = errors.New("is not a valid number") ErrIsNotSupported = errors.New("is not supported") ErrDoesNotMatch = errors.New("does not match") ErrNotAValidInteger = errors.New("not a valid integer") ErrNotAValidFloat = errors.New("not a valid float") )
Functions ¶
func InvalidFormatError ¶
func MustBase64EncodedError ¶
func MustBeSpecifiedError ¶
func MustSpecifiedOneOfError ¶
func MutuallyExclusiveError ¶
func RequireGreaterThanError ¶
func RequireLessThanError ¶
func UnsupportedValueError ¶
Types ¶
type CumulatedErrors ¶
type CumulatedErrors struct {
Errors []error
}
func NewCumulatedErrors ¶
func NewCumulatedErrors() *CumulatedErrors
func (*CumulatedErrors) Add ¶
func (e *CumulatedErrors) Add(err error)
func (*CumulatedErrors) Error ¶
func (e *CumulatedErrors) Error() string
func (*CumulatedErrors) HasAny ¶
func (e *CumulatedErrors) HasAny() bool
type Errors ¶
func (Errors) AddForProperty ¶
AddForProperty adds an error for a given property.
func (Errors) ErrorOrNil ¶
func (Errors) FinalAdd ¶
FinalAdd behaves like Add, but is meant to be called in a "return" statement. This helper is usually used for terminal errors.
func (Errors) FinalAddForProperty ¶
FinalAddForProperty behaves like AddForProperty, but is meant to be called in a "return" statement. This helper is usually used for terminal errors.
func (Errors) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.