Documentation
¶
Index ¶
- Variables
- func WithFiber[T any](c *fiber.Ctx, fns ...func(ins *T) (err error)) (T, error)
- func WithFiberPtr[T any](c *fiber.Ctx, fns ...func(ins *T) (err error)) (*T, error)
- func WithGin[T any](c *gin.Context, fns ...func(ins *T) (err error)) (T, error)
- func WithGinPtr[T any](c *gin.Context, fns ...func(ins *T) (err error)) (*T, error)
- 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, messages ...any) myError.IMyError
- func (*LengthError) Panic() myError.IMyError
- func (*LengthError) Wrap(err error) myError.IMyError
- type RequiredError
- type RuleError
- func (my *RuleError) Error() string
- func (my *RuleError) Is(target error) bool
- func (*RuleError) New(msg string) myError.IMyError
- func (my *RuleError) NewFormat(format string, messages ...any) myError.IMyError
- func (*RuleError) Panic() myError.IMyError
- func (*RuleError) Wrap(err error) myError.IMyError
- type TimeError
- func (my *TimeError) Error() string
- func (my *TimeError) Is(target error) bool
- func (*TimeError) New(msg string) myError.IMyError
- func (my *TimeError) NewFormat(format string, messages ...any) myError.IMyError
- func (*TimeError) Panic() myError.IMyError
- func (*TimeError) Wrap(err error) myError.IMyError
- type ValidateError
- func (my *ValidateError) Error() string
- func (my *ValidateError) Is(target error) bool
- func (*ValidateError) New(msg string) myError.IMyError
- func (my *ValidateError) NewFormat(format string, messages ...any) myError.IMyError
- func (*ValidateError) Panic() myError.IMyError
- func (*ValidateError) Wrap(err error) myError.IMyError
- type ValidatorApp
- func (my *ValidatorApp[T]) DateFormat(dateFormat string) *ValidatorApp[T]
- func (my *ValidatorApp[T]) DatetimeFormat(datetimeFormat string) *ValidatorApp[T]
- func (my *ValidatorApp[T]) EmailFormat(emailFormat string) *ValidatorApp[T]
- func (my *ValidatorApp[T]) TimeFormat(timeFormat string) *ValidatorApp[T]
- func (my *ValidatorApp[T]) Validate(funcs ...func(ins T) (err error)) error
- type ValidatorExCheckerApp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ValidateErr ValidateError RequiredErr RequiredError EmailErr EmailError TimeErr TimeError LengthErr LengthError RuleErr RuleError )
Functions ¶
func WithFiberPtr ¶
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, messages ...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) NewFormat ¶
func (my *ValidateError) NewFormat(format string, messages ...any) myError.IMyError
func (*ValidateError) Panic ¶
func (*ValidateError) Panic() myError.IMyError
type ValidatorApp ¶
type ValidatorApp[T any] struct { // contains filtered or unexported fields }
ValidatorApp 验证器
func (*ValidatorApp[T]) DateFormat ¶
func (my *ValidatorApp[T]) DateFormat(dateFormat string) *ValidatorApp[T]
DateFormat 设置日期默认规则
func (*ValidatorApp[T]) DatetimeFormat ¶
func (my *ValidatorApp[T]) DatetimeFormat(datetimeFormat string) *ValidatorApp[T]
DatetimeFormat 设置日期+时间默认规则
func (*ValidatorApp[T]) EmailFormat ¶
func (my *ValidatorApp[T]) EmailFormat(emailFormat string) *ValidatorApp[T]
EmailFormat 设置email默认规则
func (*ValidatorApp[T]) TimeFormat ¶
func (my *ValidatorApp[T]) TimeFormat(timeFormat string) *ValidatorApp[T]
TimeFormat 设置时间默认规则
func (*ValidatorApp[T]) Validate ¶
func (my *ValidatorApp[T]) Validate(funcs ...func(ins T) (err error)) error
Validate 执行验证
type ValidatorExCheckerApp ¶
type ValidatorExCheckerApp struct{ ExFunMap exFunMap }
var (
ValidatorExChecker ValidatorExCheckerApp
)
func (*ValidatorExCheckerApp) Once ¶
func (*ValidatorExCheckerApp) Once() *ValidatorExCheckerApp
Once 单利化:额外验证器
func (*ValidatorExCheckerApp) RegisterExFun ¶
func (my *ValidatorExCheckerApp) RegisterExFun(name string, exFun exFun) *ValidatorExCheckerApp
RegisterExFun 注册额外验证函数
Source Files
¶
Click to show internal directories.
Click to hide internal directories.