Documentation
¶
Index ¶
- Constants
- func NewRequiredError(value any) error
- func NewRequiredIfAuthTypeError(value any) error
- func ValidUrl(inputUrl string) error
- func Validate(obj any) utils.Errors
- type DurationValidator
- type PasswordValidator
- type RRuleValidator
- type RequiredIfAuthTypeValidator
- type RequiredValidator
- type UrlValidator
- type Validator
- func NewDurationValidator(params map[string]string) Validator
- func NewPasswordValidator(params map[string]string) Validator
- func NewRRuleValidator(_ map[string]string) Validator
- func NewRequiredIfAuthTypeValidator(params map[string]string) Validator
- func NewRequiredValidator(_ map[string]string) Validator
- func NewUrlValidator(params map[string]string) Validator
- type ValidatorFactory
- type ValidatorFactoryFunc
Constants ¶
View Source
const ( ErrorDuration = "invalid iso duration provided %v" ErrorDurationMin = "must be >= %s" ErrorDurationMax = "must be <= %s" )
View Source
const ( ErrorPassword = "failed to meet password requirements:\n%v" ErrorPasswordLength = "must have at least %d characters" ErrorPasswordLower = "must have at least %d lowercase characters" ErrorPasswordUpper = "must have at least %d uppercase characters" ErrorPasswordSpecial = "must have at least %d special characters" ErrorPasswordNumeric = "must have at least %d numeric characters" )
View Source
const ( ErrorUrlHttpsInvalid = "invalid https url format" ErrorUrlInvalid = "invalid url format" )
View Source
const ( ErrorValidation = "validation failed:\n%8s" ErrorUnmatchedTag = "no validator registered that matches tag: %s" )
View Source
const (
ErrInvalidRrule = "invalid rrule specified: %s"
)
Variables ¶
This section is empty.
Functions ¶
func NewRequiredError ¶
Types ¶
type DurationValidator ¶
type DurationValidator struct {
// contains filtered or unexported fields
}
type PasswordValidator ¶
type PasswordValidator struct {
Length, Lower, Upper, Special, Numeric int
}
type RRuleValidator ¶
type RRuleValidator struct {
}
type RRuleValidator struct implements the Validator interface which allows the usage of the `rrule` struct tag to ensure a string is in a valid rrule format by calling `Validate`
type RequiredIfAuthTypeValidator ¶
type RequiredIfAuthTypeValidator struct {
// contains filtered or unexported fields
}
type RequiredValidator ¶
type RequiredValidator struct{}
type UrlValidator ¶
type UrlValidator struct {
// contains filtered or unexported fields
}
UrlValidator implements the Validator interface which allows the usage of the `url` struct tag to ensure a string is in a valid url format by calling `Validate`
type Validator ¶
func NewDurationValidator ¶
func NewPasswordValidator ¶
func NewRRuleValidator ¶
NewRRuleValidator returns a new Validator
func NewRequiredValidator ¶
func NewUrlValidator ¶
NewUrlValidator returns a new Validator
type ValidatorFactory ¶
type ValidatorFactory struct {
// contains filtered or unexported fields
}
func (ValidatorFactory) NewValidatorFromTag ¶
func (s ValidatorFactory) NewValidatorFromTag(tag string) Validator
type ValidatorFactoryFunc ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.