Documentation ¶
Index ¶
- Variables
- func GenerateKey(s string) string
- type BytesArePresent
- type EmailIsPresent
- type EmailLike
- type FuncValidator
- type IntArrayIsPresent
- type IntIsGreaterThan
- type IntIsLessThan
- type IntIsPresent
- type RegexMatch
- type StringInclusion
- type StringIsPresent
- type StringLengthInRange
- type StringsMatch
- type TimeAfterTime
- type TimeIsBeforeTime
- type TimeIsPresent
- type URLIsPresent
- type UUIDIsPresent
Constants ¶
This section is empty.
Variables ¶
var CustomKeys = map[string]string{}
Functions ¶
func GenerateKey ¶
Types ¶
type BytesArePresent ¶
func (*BytesArePresent) IsValid ¶
func (v *BytesArePresent) IsValid(errors *validate.Errors)
IsValid adds an error if the field is not empty.
type EmailIsPresent ¶
func (*EmailIsPresent) IsValid ¶
func (v *EmailIsPresent) IsValid(errors *validate.Errors)
IsValid performs the validation based on the email regexp match.
type EmailLike ¶
EmailLike checks that email has two parts (username and domain separated by @) Also it check that domain have domain zone (don`t check that zone is valid)
type FuncValidator ¶
func (*FuncValidator) IsValid ¶
func (f *FuncValidator) IsValid(verrs *validate.Errors)
type IntArrayIsPresent ¶
func (*IntArrayIsPresent) IsValid ¶
func (v *IntArrayIsPresent) IsValid(errors *validate.Errors)
IsValid adds an error if the field is an empty array.
type IntIsGreaterThan ¶
func (*IntIsGreaterThan) IsValid ¶
func (v *IntIsGreaterThan) IsValid(errors *validate.Errors)
IsValid adds an error if the field is not greater than the compared value.
type IntIsLessThan ¶
func (*IntIsLessThan) IsValid ¶
func (v *IntIsLessThan) IsValid(errors *validate.Errors)
IsValid adds an error if the field is not less than the compared value.
type IntIsPresent ¶
func (*IntIsPresent) IsValid ¶
func (v *IntIsPresent) IsValid(errors *validate.Errors)
IsValid adds an error if the field equals 0.
type RegexMatch ¶
RegexMatch specifies the properties needed by the validation.
func (*RegexMatch) IsValid ¶
func (v *RegexMatch) IsValid(errors *validate.Errors)
IsValid performs the validation based on the regexp match.
type StringInclusion ¶
func (*StringInclusion) IsValid ¶
func (v *StringInclusion) IsValid(errors *validate.Errors)
IsValid adds an error if the field is not one of the allowed values.
type StringIsPresent ¶
func (*StringIsPresent) IsValid ¶
func (v *StringIsPresent) IsValid(errors *validate.Errors)
IsValid adds an error if the field is empty.
type StringLengthInRange ¶
func (*StringLengthInRange) IsValid ¶
func (v *StringLengthInRange) IsValid(errors *validate.Errors)
IsValid checks that string in range of min:max if max not present or it equal to 0 it will be equal to string length
type StringsMatch ¶
func (*StringsMatch) IsValid ¶
func (v *StringsMatch) IsValid(errors *validate.Errors)
IsValid performs the validation equality of two strings.
type TimeAfterTime ¶
type TimeAfterTime struct { FirstName string FirstTime time.Time SecondName string SecondTime time.Time Message string }
func (*TimeAfterTime) IsValid ¶
func (v *TimeAfterTime) IsValid(errors *validate.Errors)
IsValid adds an error if the FirstTime is not after the SecondTime.
type TimeIsBeforeTime ¶
type TimeIsBeforeTime struct { FirstName string FirstTime time.Time SecondName string SecondTime time.Time Message string }
func (*TimeIsBeforeTime) IsValid ¶
func (v *TimeIsBeforeTime) IsValid(errors *validate.Errors)
IsValid adds an error if the FirstTime is after the SecondTime.
type TimeIsPresent ¶
func (*TimeIsPresent) IsValid ¶
func (v *TimeIsPresent) IsValid(errors *validate.Errors)
IsValid adds an error if the field is not a valid time.
type URLIsPresent ¶
func (*URLIsPresent) IsValid ¶
func (v *URLIsPresent) IsValid(errors *validate.Errors)
IsValid performs the validation to check if URL is formatted correctly uses net/url ParseRequestURI to check validity
Source Files ¶
- bytes_are_present.go
- common.go
- email_is_present.go
- func_validator.go
- int_array_is_present.go
- int_is_greater_than.go
- int_is_less_than.go
- int_is_present.go
- regex_match.go
- string_inclusion.go
- string_is_present.go
- string_length_in_range.go
- strings_match.go
- time_after_time.go
- time_is_before_time.go
- time_is_present.go
- url_is_present.go
- uuid_is_present.go