Documentation
¶
Index ¶
- Variables
- type EmailError
- type LengthError
- func (my *LengthError) Error() string
- func (my *LengthError) Is(target error) bool
- func (*LengthError) New(msg string) myError.IMyError
- func (my *LengthError) NewFormat(format string, msgs ...any) myError.IMyError
- func (*LengthError) Panic() myError.IMyError
- func (*LengthError) Wrap(err error) myError.IMyError
- type RequiredError
- type RuleError
- type TimeError
- type ValidateError
- type Validator
- func (my *Validator[T]) DateFormat(dateFormat string) *Validator[T]
- func (my *Validator[T]) DatetimeFormat(datetimeFormat string) *Validator[T]
- func (my *Validator[T]) EmailFormat(emailFormat string) *Validator[T]
- func (my *Validator[T]) TimeFormat(timeFormat string) *Validator[T]
- func (my *Validator[T]) Validate(exChecks ...func(item T) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ValidateErr ValidateError RequiredErr RequiredError EmailErr EmailError TimeErr TimeError LengthErr LengthError RuleErr RuleError )
Functions ¶
This section is empty.
Types ¶
type EmailError ¶
func (*EmailError) Error ¶
func (my *EmailError) Error() string
func (*EmailError) Is ¶
func (my *EmailError) Is(target error) bool
func (*EmailError) Panic ¶
func (*EmailError) Panic() myError.IMyError
type LengthError ¶
func (*LengthError) Error ¶
func (my *LengthError) Error() string
func (*LengthError) Is ¶
func (my *LengthError) Is(target error) bool
func (*LengthError) NewFormat ¶
func (my *LengthError) NewFormat(format string, msgs ...any) myError.IMyError
func (*LengthError) Panic ¶
func (*LengthError) Panic() myError.IMyError
type RequiredError ¶
func (*RequiredError) Error ¶
func (my *RequiredError) Error() string
func (*RequiredError) Is ¶
func (my *RequiredError) Is(target error) bool
func (*RequiredError) Panic ¶
func (*RequiredError) Panic() myError.IMyError
type ValidateError ¶
func (*ValidateError) Error ¶
func (my *ValidateError) Error() string
func (*ValidateError) Is ¶
func (my *ValidateError) Is(target error) bool
func (*ValidateError) Panic ¶
func (*ValidateError) Panic() myError.IMyError
type Validator ¶
type Validator[T any] struct { // contains filtered or unexported fields }
Validator 验证器 验证规则 -> [required] [email|datetime|date|time] [min<|min<=] [max>|max=] [range=]
func NewValidator ¶
NewValidator 实例化:验证器
func (*Validator[T]) DateFormat ¶
DateFormat 设置日期默认规则
func (*Validator[T]) DatetimeFormat ¶
DatetimeFormat 设置日期+时间默认规则
func (*Validator[T]) EmailFormat ¶
EmailFormat 设置email默认规则
func (*Validator[T]) TimeFormat ¶
TimeFormat 设置时间默认规则
Click to show internal directories.
Click to hide internal directories.