Documentation ¶
Index ¶
- Constants
- func ErrorLengthEqualTo(length int, limit int) error
- func ErrorLengthNotEqualTo(length int, limit int) error
- func ErrorLengthNotGreaterThan(length int, limit int) error
- func ErrorLengthNotGreaterThanOrEqualTo(length int, limit int) error
- func ErrorLengthNotInRange(length int, lowerLimit int, upperLimit int) error
- func ErrorLengthNotLessThan(length int, limit int) error
- func ErrorLengthNotLessThanOrEqualTo(length int, limit int) error
- func ErrorValueEmpty() error
- func ErrorValueEqualTo(value interface{}, limit interface{}) error
- func ErrorValueExists() error
- func ErrorValueFloat64NotOneOf(value float64, allowedValues []float64) error
- func ErrorValueFloat64OneOf(value float64, disallowedValues []float64) error
- func ErrorValueIntNotOneOf(value int, allowedValues []int) error
- func ErrorValueIntOneOf(value int, disallowedValues []int) error
- func ErrorValueNotEmpty() error
- func ErrorValueNotEqualTo(value interface{}, limit interface{}) error
- func ErrorValueNotExists() error
- func ErrorValueNotFalse() error
- func ErrorValueNotGreaterThan(value interface{}, limit interface{}) error
- func ErrorValueNotGreaterThanOrEqualTo(value interface{}, limit interface{}) error
- func ErrorValueNotInRange(value interface{}, lowerLimit interface{}, upperLimit interface{}) error
- func ErrorValueNotLessThan(value interface{}, limit interface{}) error
- func ErrorValueNotLessThanOrEqualTo(value interface{}, limit interface{}) error
- func ErrorValueNotTrue() error
- func ErrorValueStringMatches(value string, expression *regexp.Regexp) error
- func ErrorValueStringNotMatches(value string, expression *regexp.Regexp) error
- func ErrorValueStringNotOneOf(value string, allowedValues []string) error
- func ErrorValueStringOneOf(value string, disallowedValues []string) error
- func ErrorValueTimeNotAfter(value time.Time, limit time.Time) error
- func ErrorValueTimeNotAfterNow(value time.Time) error
- func ErrorValueTimeNotBefore(value time.Time, limit time.Time) error
- func ErrorValueTimeNotBeforeNow(value time.Time) error
- func ErrorValueTimeNotZero(value time.Time) error
- func ErrorValueTimeZero(value time.Time) error
- func ExpressionAsString(expression *regexp.Regexp) string
- func QuoteIfString(interfaceValue interface{}) interface{}
- type Bool
- type Float64
- func (f *Float64) EqualTo(value float64) structure.Float64
- func (f *Float64) Exists() structure.Float64
- func (f *Float64) GreaterThan(limit float64) structure.Float64
- func (f *Float64) GreaterThanOrEqualTo(limit float64) structure.Float64
- func (f *Float64) InRange(lowerLimit float64, upperLimit float64) structure.Float64
- func (f *Float64) LessThan(limit float64) structure.Float64
- func (f *Float64) LessThanOrEqualTo(limit float64) structure.Float64
- func (f *Float64) NotEqualTo(value float64) structure.Float64
- func (f *Float64) NotExists() structure.Float64
- func (f *Float64) NotOneOf(disallowedValues ...float64) structure.Float64
- func (f *Float64) OneOf(allowedValues ...float64) structure.Float64
- type Int
- func (i *Int) EqualTo(value int) structure.Int
- func (i *Int) Exists() structure.Int
- func (i *Int) GreaterThan(limit int) structure.Int
- func (i *Int) GreaterThanOrEqualTo(limit int) structure.Int
- func (i *Int) InRange(lowerLimit int, upperLimit int) structure.Int
- func (i *Int) LessThan(limit int) structure.Int
- func (i *Int) LessThanOrEqualTo(limit int) structure.Int
- func (i *Int) NotEqualTo(value int) structure.Int
- func (i *Int) NotExists() structure.Int
- func (i *Int) NotOneOf(disallowedValues ...int) structure.Int
- func (i *Int) OneOf(allowedValues ...int) structure.Int
- type String
- func (s *String) Empty() structure.String
- func (s *String) EqualTo(value string) structure.String
- func (s *String) Exists() structure.String
- func (s *String) LengthEqualTo(limit int) structure.String
- func (s *String) LengthGreaterThan(limit int) structure.String
- func (s *String) LengthGreaterThanOrEqualTo(limit int) structure.String
- func (s *String) LengthInRange(lowerLimit int, upperLimit int) structure.String
- func (s *String) LengthLessThan(limit int) structure.String
- func (s *String) LengthLessThanOrEqualTo(limit int) structure.String
- func (s *String) LengthNotEqualTo(limit int) structure.String
- func (s *String) Matches(expression *regexp.Regexp) structure.String
- func (s *String) NotEmpty() structure.String
- func (s *String) NotEqualTo(value string) structure.String
- func (s *String) NotExists() structure.String
- func (s *String) NotMatches(expression *regexp.Regexp) structure.String
- func (s *String) NotOneOf(disallowedValues ...string) structure.String
- func (s *String) OneOf(allowedValues ...string) structure.String
- type StringArray
- func (s *StringArray) EachMatches(expression *regexp.Regexp) structure.StringArray
- func (s *StringArray) EachNotMatches(expression *regexp.Regexp) structure.StringArray
- func (s *StringArray) EachNotOneOf(disallowedValues ...string) structure.StringArray
- func (s *StringArray) EachOneOf(allowedValues ...string) structure.StringArray
- func (s *StringArray) Empty() structure.StringArray
- func (s *StringArray) Exists() structure.StringArray
- func (s *StringArray) LengthEqualTo(limit int) structure.StringArray
- func (s *StringArray) LengthGreaterThan(limit int) structure.StringArray
- func (s *StringArray) LengthGreaterThanOrEqualTo(limit int) structure.StringArray
- func (s *StringArray) LengthInRange(lowerLimit int, upperLimit int) structure.StringArray
- func (s *StringArray) LengthLessThan(limit int) structure.StringArray
- func (s *StringArray) LengthLessThanOrEqualTo(limit int) structure.StringArray
- func (s *StringArray) LengthNotEqualTo(limit int) structure.StringArray
- func (s *StringArray) NotEmpty() structure.StringArray
- func (s *StringArray) NotExists() structure.StringArray
- type Time
- func (t *Time) After(limit time.Time) structure.Time
- func (t *Time) AfterNow(threshold time.Duration) structure.Time
- func (t *Time) Before(limit time.Time) structure.Time
- func (t *Time) BeforeNow(threshold time.Duration) structure.Time
- func (t *Time) Exists() structure.Time
- func (t *Time) NotExists() structure.Time
- func (t *Time) NotZero() structure.Time
- func (t *Time) Zero() structure.Time
- type ValidatableWithString
- type ValidatableWithStringAdapter
- type ValidatableWithStringArray
- type ValidatableWithStringArrayAdapter
- type Validating
- type Validator
- func (v *Validator) Bool(reference string, value *bool) structure.Bool
- func (v *Validator) Float64(reference string, value *float64) structure.Float64
- func (v *Validator) Int(reference string, value *int) structure.Int
- func (v *Validator) String(reference string, value *string) structure.String
- func (v *Validator) StringArray(reference string, value *[]string) structure.StringArray
- func (v *Validator) Time(reference string, value *time.Time) structure.Time
- func (v *Validator) Validate(validatable structure.Validatable) error
- func (v *Validator) Validating(reference string, value structure.Validatable) structure.Validating
- func (v *Validator) WithMeta(meta interface{}) structure.Validator
- func (v *Validator) WithReference(reference string) structure.Validator
- func (v *Validator) WithSource(source structure.Source) *Validator
Constants ¶
View Source
const ( ErrorCodeValueNotExists = "value-not-exists" ErrorCodeValueExists = "value-exists" ErrorCodeValueNotEmpty = "value-not-empty" ErrorCodeValueEmpty = "value-empty" ErrorCodeValueNotTrue = "value-not-true" ErrorCodeValueNotFalse = "value-not-false" ErrorCodeValueOutOfRange = "value-out-of-range" ErrorCodeValueDisallowed = "value-disallowed" ErrorCodeValueNotAllowed = "value-not-allowed" ErrorCodeValueMatches = "value-matches" ErrorCodeValueNotMatches = "value-not-matches" ErrorCodeValueZero = "value-zero" ErrorCodeValueNotZero = "value-not-zero" ErrorCodeValueNotAfter = "value-not-after" ErrorCodeValueNotBefore = "value-not-before" ErrorCodeLengthOutOfRange = "length-out-of-range" )
Variables ¶
This section is empty.
Functions ¶
func ErrorLengthEqualTo ¶
func ErrorLengthNotEqualTo ¶
func ErrorLengthNotInRange ¶
func ErrorLengthNotLessThan ¶
func ErrorValueEmpty ¶
func ErrorValueEmpty() error
func ErrorValueEqualTo ¶
func ErrorValueEqualTo(value interface{}, limit interface{}) error
func ErrorValueExists ¶
func ErrorValueExists() error
func ErrorValueFloat64OneOf ¶
func ErrorValueIntNotOneOf ¶
func ErrorValueIntOneOf ¶
func ErrorValueNotEmpty ¶
func ErrorValueNotEmpty() error
func ErrorValueNotEqualTo ¶
func ErrorValueNotEqualTo(value interface{}, limit interface{}) error
func ErrorValueNotExists ¶
func ErrorValueNotExists() error
func ErrorValueNotFalse ¶
func ErrorValueNotFalse() error
func ErrorValueNotGreaterThan ¶
func ErrorValueNotGreaterThan(value interface{}, limit interface{}) error
func ErrorValueNotGreaterThanOrEqualTo ¶
func ErrorValueNotGreaterThanOrEqualTo(value interface{}, limit interface{}) error
func ErrorValueNotInRange ¶
func ErrorValueNotInRange(value interface{}, lowerLimit interface{}, upperLimit interface{}) error
func ErrorValueNotLessThan ¶
func ErrorValueNotLessThan(value interface{}, limit interface{}) error
func ErrorValueNotLessThanOrEqualTo ¶
func ErrorValueNotLessThanOrEqualTo(value interface{}, limit interface{}) error
func ErrorValueNotTrue ¶
func ErrorValueNotTrue() error
func ErrorValueStringMatches ¶
func ErrorValueStringOneOf ¶
func ErrorValueTimeNotZero ¶
func ErrorValueTimeZero ¶
func ExpressionAsString ¶
func QuoteIfString ¶
func QuoteIfString(interfaceValue interface{}) interface{}
Types ¶
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
func (*Float64) GreaterThanOrEqualTo ¶
func (*Float64) LessThanOrEqualTo ¶
type String ¶
type String struct {
// contains filtered or unexported fields
}
func (*String) LengthGreaterThanOrEqualTo ¶
func (*String) LengthInRange ¶
func (*String) LengthLessThanOrEqualTo ¶
type StringArray ¶
type StringArray struct {
// contains filtered or unexported fields
}
func NewStringArray ¶
func NewStringArray(base structure.Base, value *[]string) *StringArray
func (*StringArray) EachMatches ¶
func (s *StringArray) EachMatches(expression *regexp.Regexp) structure.StringArray
func (*StringArray) EachNotMatches ¶
func (s *StringArray) EachNotMatches(expression *regexp.Regexp) structure.StringArray
func (*StringArray) EachNotOneOf ¶
func (s *StringArray) EachNotOneOf(disallowedValues ...string) structure.StringArray
func (*StringArray) EachOneOf ¶
func (s *StringArray) EachOneOf(allowedValues ...string) structure.StringArray
func (*StringArray) Empty ¶
func (s *StringArray) Empty() structure.StringArray
func (*StringArray) Exists ¶
func (s *StringArray) Exists() structure.StringArray
func (*StringArray) LengthEqualTo ¶
func (s *StringArray) LengthEqualTo(limit int) structure.StringArray
func (*StringArray) LengthGreaterThan ¶
func (s *StringArray) LengthGreaterThan(limit int) structure.StringArray
func (*StringArray) LengthGreaterThanOrEqualTo ¶
func (s *StringArray) LengthGreaterThanOrEqualTo(limit int) structure.StringArray
func (*StringArray) LengthInRange ¶
func (s *StringArray) LengthInRange(lowerLimit int, upperLimit int) structure.StringArray
func (*StringArray) LengthLessThan ¶
func (s *StringArray) LengthLessThan(limit int) structure.StringArray
func (*StringArray) LengthLessThanOrEqualTo ¶
func (s *StringArray) LengthLessThanOrEqualTo(limit int) structure.StringArray
func (*StringArray) LengthNotEqualTo ¶
func (s *StringArray) LengthNotEqualTo(limit int) structure.StringArray
func (*StringArray) NotEmpty ¶
func (s *StringArray) NotEmpty() structure.StringArray
func (*StringArray) NotExists ¶
func (s *StringArray) NotExists() structure.StringArray
type ValidatableWithString ¶
type ValidatableWithStringAdapter ¶
type ValidatableWithStringAdapter struct {
// contains filtered or unexported fields
}
func NewValidatableWithStringAdapter ¶
func NewValidatableWithStringAdapter(validatableWithString ValidatableWithString, str *string) *ValidatableWithStringAdapter
func (*ValidatableWithStringAdapter) Validate ¶
func (v *ValidatableWithStringAdapter) Validate(validator structure.Validator)
type ValidatableWithStringArrayAdapter ¶
type ValidatableWithStringArrayAdapter struct {
// contains filtered or unexported fields
}
func NewValidatableWithStringArrayAdapter ¶
func NewValidatableWithStringArrayAdapter(validatableWithStringArray ValidatableWithStringArray, strArray *[]string) *ValidatableWithStringArrayAdapter
func (*ValidatableWithStringArrayAdapter) Validate ¶
func (v *ValidatableWithStringArrayAdapter) Validate(validator structure.Validator)
type Validating ¶
type Validating struct {
// contains filtered or unexported fields
}
func NewValidating ¶
func NewValidating(base structure.Base, value structure.Validatable) *Validating
func (*Validating) Exists ¶
func (v *Validating) Exists() structure.Validating
func (*Validating) NotExists ¶
func (v *Validating) NotExists() structure.Validating
func (*Validating) Validate ¶
func (v *Validating) Validate() structure.Validating
type Validator ¶
func NewValidator ¶
func (*Validator) StringArray ¶
func (v *Validator) StringArray(reference string, value *[]string) structure.StringArray
func (*Validator) Validating ¶
func (v *Validator) Validating(reference string, value structure.Validatable) structure.Validating
func (*Validator) WithReference ¶
Click to show internal directories.
Click to hide internal directories.