Versions in this module Expand all Collapse all v1 v1.1.0 Jun 29, 2023 Changes in this version + func IsEmail(email string) bool + type EmailValidator struct + func Email() *EmailValidator + func (c *EmailValidator) MarshalJSON() ([]byte, error) + type Error interface + Error func() string + Field func() string + func NewError(message, fieldName string) Error + type Errors []Error + func (v Errors) Error() string + type FieldFuncValidator struct + func (c *FieldFuncValidator) HTMLCompatible() bool + func (c *FieldFuncValidator) Name() string + func (c *FieldFuncValidator) SetMessage(msg string) Validator + func (c *FieldFuncValidator) SetName(name string) + func (c *FieldFuncValidator) Validate(value interface{}) Error + type MaxIntValidator struct + func MaxInt(max int64) *MaxIntValidator + func (c *MaxIntValidator) HTMLCompatible() bool + func (c *MaxIntValidator) MarshalJSON() ([]byte, error) + func (c *MaxIntValidator) Name() string + func (c *MaxIntValidator) SetMessage(msg string) Validator + func (c *MaxIntValidator) SetName(name string) + func (c *MaxIntValidator) Validate(value interface{}) Error + type MaxStrValidator struct + func MaxStr(max int64) *MaxStrValidator + func (c *MaxStrValidator) HTMLCompatible() bool + func (c *MaxStrValidator) MarshalJSON() ([]byte, error) + func (c *MaxStrValidator) Name() string + func (c *MaxStrValidator) SetMessage(msg string) Validator + func (c *MaxStrValidator) SetName(name string) + func (c *MaxStrValidator) Validate(value interface{}) Error + type MinIntValidator struct + func MinInt(min int64) *MinIntValidator + func (c *MinIntValidator) HTMLCompatible() bool + func (c *MinIntValidator) MarshalJSON() ([]byte, error) + func (c *MinIntValidator) Name() string + func (c *MinIntValidator) Optional() Validator + func (c *MinIntValidator) SetMessage(msg string) Validator + func (c *MinIntValidator) SetName(name string) + func (c *MinIntValidator) Validate(value interface{}) Error + type MinStrValidator struct + func MinStr(min int64) *MinStrValidator + func (c *MinStrValidator) HTMLCompatible() bool + func (c *MinStrValidator) MarshalJSON() ([]byte, error) + func (c *MinStrValidator) Name() string + func (c *MinStrValidator) Optional() Validator + func (c *MinStrValidator) SetMessage(msg string) Validator + func (c *MinStrValidator) SetName(name string) + func (c *MinStrValidator) Validate(value interface{}) Error + type PatternValidator struct + func Pattern(pattern string) *PatternValidator + func (c *PatternValidator) HTMLCompatible() bool + func (c *PatternValidator) MarshalJSON() ([]byte, error) + func (c *PatternValidator) Name() string + func (c *PatternValidator) Optional() Validator + func (c *PatternValidator) SetMessage(msg string) Validator + func (c *PatternValidator) SetName(name string) + func (c *PatternValidator) Validate(value interface{}) Error + type RequiredValidator struct + func Required() *RequiredValidator + func (c *RequiredValidator) HTMLCompatible() bool + func (c *RequiredValidator) MarshalJSON() ([]byte, error) + func (c *RequiredValidator) Name() string + func (c *RequiredValidator) SetMessage(msg string) Validator + func (c *RequiredValidator) SetName(name string) + func (c *RequiredValidator) Validate(value interface{}) Error + type Rules struct + func New(structPtr interface{}) Rules + func (r Rules) Field(fieldPtr interface{}, validators ...Validator) Rules + func (r Rules) OnlyFor(name string) Rules + func (r Rules) Struct(validators ...Validator) Rules + func (r Rules) Validate(subject interface{}) error + func (r Rules) Validators() []Validator + type StructFuncValidator struct + func (c *StructFuncValidator) HTMLCompatible() bool + func (c *StructFuncValidator) Name() string + func (c *StructFuncValidator) SetMessage(msg string) Validator + func (c *StructFuncValidator) SetName(name string) + func (c *StructFuncValidator) Validate(value interface{}) Error + type Validator interface + HTMLCompatible func() bool + Name func() string + SetMessage func(string) Validator + SetName func(string) + Validate func(interface{}) Error + func FieldFunc(f func(string, interface{}) Error) Validator + func StructFunc(f func(interface{}) Error) Validator