Documentation ¶
Index ¶
- func IsTrueFalse(str string) bool
- func IsUrl(str string) bool
- func IsValidAddressLine(ctx context.Context, e string) (err error)
- func IsValidCountry(e string, min, max int) (b bool)
- func IsValidDate(d string) (b bool)
- func IsValidDateRange(ctx context.Context, startDate string, endDate string) (b bool)
- func IsValidEmail(e string) (b bool)
- func IsValidName(e string, min, max int) (b bool)
- func IsValidUUID(u string) bool
- func IsValidWord(e string, min, max int) (b bool)
- func LengthRange(s string, min, max int) bool
- func TestValidation(t *testing.T)
- type DefaultValidator
- type EmailValidator
- type NumberValidator
- type StringValidator
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTrueFalse ¶
func IsValidCountry ¶
func IsValidDate ¶
func IsValidDateRange ¶
func IsValidEmail ¶
func IsValidName ¶
func IsValidUUID ¶
func IsValidWord ¶
func LengthRange ¶
Types ¶
type DefaultValidator ¶
type DefaultValidator struct { }
DefaultValidator does not perform any validations.
func (DefaultValidator) Validate ¶
func (v DefaultValidator) Validate(val interface{}) (bool, error)
type EmailValidator ¶
type EmailValidator struct { }
EmailValidator checks if string is a valid email address.
func (EmailValidator) Validate ¶
func (v EmailValidator) Validate(val interface{}) (bool, error)
type NumberValidator ¶
NumberValidator performs numerical value validation. Its limited to int type for simplicity.
func (NumberValidator) Validate ¶
func (v NumberValidator) Validate(val interface{}) (bool, error)
type StringValidator ¶
StringValidator validates string presence and/or its length.
func (StringValidator) Validate ¶
func (v StringValidator) Validate(val interface{}) (bool, error)
Click to show internal directories.
Click to hide internal directories.