Documentation ¶
Index ¶
- func EnableRegexpCache(cache lru.Interface[string, *regexp.Regexp])
- type IntegerOrString
- type RangeMode
- type RegexpOrString
- type Result
- type Rule
- type RuleFunc
- func GreaterThanZero[T IntegerOrString](name string, value T, save bool) RuleFunc
- func InRange[T constraints.Integer](name string, min, max T, value T) RuleFunc
- func InRangeMode[T constraints.Integer](name string, mode RangeMode, min, max T, value T) RuleFunc
- func LessThanOrEqual[T constraints.Integer](name string, limit, value T) RuleFunc
- func MatchRegexp[T RegexpOrString](name string, pattern T, value string) RuleFunc
- func NotNil(name string, value any) RuleFunc
- func ParseStrsToInt64Map(name string, values []string) RuleFunc
- func ParseStrsToInt64Slice(name string, values []string) RuleFunc
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IntegerOrString ¶ added in v2.10.0
type IntegerOrString interface { constraints.Integer | ~string }
type RegexpOrString ¶ added in v2.10.0
type RuleFunc ¶
func GreaterThanZero ¶
func GreaterThanZero[T IntegerOrString](name string, value T, save bool) RuleFunc
func InRangeMode ¶
func InRangeMode[T constraints.Integer](name string, mode RangeMode, min, max T, value T) RuleFunc
func LessThanOrEqual ¶
func LessThanOrEqual[T constraints.Integer](name string, limit, value T) RuleFunc
func MatchRegexp ¶ added in v2.10.0
func MatchRegexp[T RegexpOrString](name string, pattern T, value string) RuleFunc
func ParseStrsToInt64Map ¶ added in v2.10.0
func ParseStrsToInt64Slice ¶ added in v2.10.0
type ValidationError ¶ added in v2.10.0
func (*ValidationError) Error ¶ added in v2.10.0
func (e *ValidationError) Error() string
func (*ValidationError) Unwrap ¶ added in v2.10.0
func (e *ValidationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.