Documentation
¶
Index ¶
- func After[T any](f form.TimeField[T], t time.Time) form.Rule[T]
- func AfterWithCode[T any](f form.TimeField[T], t time.Time, code form.Code) form.Rule[T]
- func Alpha[T any](f form.StringField[T]) form.Rule[T]
- func AlphaDash[T any](f form.StringField[T]) form.Rule[T]
- func AlphaDashWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func AlphaNum[T any](f form.StringField[T]) form.Rule[T]
- func AlphaNumWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func AlphaWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func Before[T any](f form.TimeField[T], t time.Time) form.Rule[T]
- func BeforeWithCode[T any](f form.TimeField[T], t time.Time, code form.Code) form.Rule[T]
- func BetweenFloat64[T any](f form.Float64Field[T], min, max float64) form.Rule[T]
- func BetweenFloat64WithCode[T any](f form.Float64Field[T], min, max float64, code form.Code) form.Rule[T]
- func BetweenInt[T any](f form.IntField[T], min, max int) form.Rule[T]
- func BetweenIntWithCode[T any](f form.IntField[T], min, max int, code form.Code) form.Rule[T]
- func BetweenTime[T any](f form.TimeField[T], min, max time.Time) form.Rule[T]
- func BetweenTimeWithCode[T any](f form.TimeField[T], min, max time.Time, code form.Code) form.Rule[T]
- func BoolEquals[T any](f form.BoolField[T], expected bool) form.Rule[T]
- func BoolEqualsWithCode[T any](f form.BoolField[T], expected bool, code form.Code) form.Rule[T]
- func Compare[T any, V Ordered](aF form.Field[T, V], bF form.Field[T, V], op CompareOp) form.Rule[T]
- func CompareWithCode[T any, V Ordered](aF form.Field[T, V], bF form.Field[T, V], op CompareOp, code form.Code) form.Rule[T]
- func Contains[T any](f form.StringField[T], needle string) form.Rule[T]
- func ContainsWithCode[T any](f form.StringField[T], needle string, code form.Code) form.Rule[T]
- func DistinctStr[T any](f form.SliceStringField[T]) form.Rule[T]
- func DistinctStrWithCode[T any](f form.SliceStringField[T], code form.Code) form.Rule[T]
- func EachStr[T any](f form.SliceStringField[T], rules ...StrValueRule) form.Rule[T]
- func Email[T any](f form.StringField[T]) form.Rule[T]
- func EmailWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func EndsWith[T any](f form.StringField[T], suffix string) form.Rule[T]
- func EndsWithWithCode[T any](f form.StringField[T], suffix string, code form.Code) form.Rule[T]
- func IP[T any](f form.StringField[T]) form.Rule[T]
- func IPWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func IsBool[T any](f form.BoolField[T]) form.Rule[T]
- func IsFalse[T any](f form.BoolField[T]) form.Rule[T]
- func IsFalseWithCode[T any](f form.BoolField[T], code form.Code) form.Rule[T]
- func IsTrue[T any](f form.BoolField[T]) form.Rule[T]
- func IsTrueWithCode[T any](f form.BoolField[T], code form.Code) form.Rule[T]
- func JSON[T any](f form.StringField[T]) form.Rule[T]
- func JSONWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func Len[T any](f form.StringField[T], n int) form.Rule[T]
- func LenWithCode[T any](f form.StringField[T], n int, code form.Code) form.Rule[T]
- func Lowercase[T any](f form.StringField[T]) form.Rule[T]
- func LowercaseWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func Max[T any](f form.IntField[T], n int) form.Rule[T]
- func MaxFloat64[T any](f form.Float64Field[T], n float64) form.Rule[T]
- func MaxFloat64WithCode[T any](f form.Float64Field[T], n float64, code form.Code) form.Rule[T]
- func MaxItemsStr[T any](f form.SliceStringField[T], n int) form.Rule[T]
- func MaxItemsStrWithCode[T any](f form.SliceStringField[T], n int, code form.Code) form.Rule[T]
- func MaxLen[T any](f form.StringField[T], n int) form.Rule[T]
- func MaxLenWithCode[T any](f form.StringField[T], n int, code form.Code) form.Rule[T]
- func MaxWithCode[T any](f form.IntField[T], n int, code form.Code) form.Rule[T]
- func Min[T any](f form.IntField[T], n int) form.Rule[T]
- func MinFloat64[T any](f form.Float64Field[T], n float64) form.Rule[T]
- func MinFloat64WithCode[T any](f form.Float64Field[T], n float64, code form.Code) form.Rule[T]
- func MinItemsStr[T any](f form.SliceStringField[T], n int) form.Rule[T]
- func MinItemsStrWithCode[T any](f form.SliceStringField[T], n int, code form.Code) form.Rule[T]
- func MinLen[T any](f form.StringField[T], n int) form.Rule[T]
- func MinLenWithCode[T any](f form.StringField[T], n int, code form.Code) form.Rule[T]
- func MinWithCode[T any](f form.IntField[T], n int, code form.Code) form.Rule[T]
- func NotNil[T any, V any](f form.Field[T, *V]) form.Rule[T]
- func NotNilWithCode[T any, V any](f form.Field[T, *V], code form.Code) form.Rule[T]
- func NotRegex[T any](f form.StringField[T], re *regexp.Regexp) form.Rule[T]
- func NotRegexWithCode[T any](f form.StringField[T], re *regexp.Regexp, code form.Code) form.Rule[T]
- func OneOf[T any, V comparable](f form.Field[T, V], allowed ...V) form.Rule[T]
- func OneOfWithCode[T any, V comparable](f form.Field[T, V], code form.Code, allowed ...V) form.Rule[T]
- func Regex[T any](f form.StringField[T], re *regexp.Regexp) form.Rule[T]
- func RegexWithCode[T any](f form.StringField[T], re *regexp.Regexp, code form.Code) form.Rule[T]
- func Required[T any](f form.StringField[T]) form.Rule[T]
- func RequiredBool[T any](f form.BoolField[T]) form.Rule[T]
- func RequiredBoolWithCode[T any](f form.BoolField[T], code form.Code) form.Rule[T]
- func RequiredField[T any, V any](f form.Field[T, V]) form.Rule[T]
- func RequiredFieldWithCode[T any, V any](f form.Field[T, V], code form.Code) form.Rule[T]
- func RequiredInt[T any](f form.IntField[T]) form.Rule[T]
- func RequiredIntWithCode[T any](f form.IntField[T], code form.Code) form.Rule[T]
- func RequiredOptBool[T any](f form.OptBoolField[T]) form.Rule[T]
- func RequiredOptBoolWithCode[T any](f form.OptBoolField[T], code form.Code) form.Rule[T]
- func RequiredOptInt[T any](f form.OptIntField[T]) form.Rule[T]
- func RequiredOptIntWithCode[T any](f form.OptIntField[T], code form.Code) form.Rule[T]
- func RequiredOptStr[T any](f form.OptStringField[T]) form.Rule[T]
- func RequiredOptStrWithCode[T any](f form.OptStringField[T], code form.Code) form.Rule[T]
- func RequiredOptTime[T any](f form.OptTimeField[T]) form.Rule[T]
- func RequiredOptTimeWithCode[T any](f form.OptTimeField[T], code form.Code) form.Rule[T]
- func RequiredSliceStr[T any](f form.SliceStringField[T]) form.Rule[T]
- func RequiredSliceStrWithCode[T any](f form.SliceStringField[T], code form.Code) form.Rule[T]
- func RequiredStr[T any](f form.StringField[T]) form.Rule[T]
- func RequiredStrWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func RequiredTime[T any](f form.TimeField[T]) form.Rule[T]
- func RequiredTimeWithCode[T any](f form.TimeField[T], code form.Code) form.Rule[T]
- func RequiredWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func StartsWith[T any](f form.StringField[T], prefix string) form.Rule[T]
- func StartsWithWithCode[T any](f form.StringField[T], prefix string, code form.Code) form.Rule[T]
- func Timezone[T any](f form.StringField[T]) form.Rule[T]
- func TimezoneWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func URL[T any](f form.StringField[T]) form.Rule[T]
- func URLWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func UUID[T any](f form.StringField[T]) form.Rule[T]
- func UUIDWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- func Uppercase[T any](f form.StringField[T]) form.Rule[T]
- func UppercaseWithCode[T any](f form.StringField[T], code form.Code) form.Rule[T]
- type CompareOp
- type Ordered
- type StrValueRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterWithCode ¶
func AlphaDashWithCode ¶
func AlphaNumWithCode ¶
func AlphaWithCode ¶
func BeforeWithCode ¶
func BetweenFloat64 ¶
func BetweenFloat64WithCode ¶
func BetweenIntWithCode ¶
func BetweenTimeWithCode ¶
func BoolEqualsWithCode ¶
func CompareWithCode ¶
func ContainsWithCode ¶
func DistinctStr ¶
func DistinctStr[T any](f form.SliceStringField[T]) form.Rule[T]
func DistinctStrWithCode ¶
func EachStr ¶
func EachStr[T any](f form.SliceStringField[T], rules ...StrValueRule) form.Rule[T]
func EmailWithCode ¶
func EndsWithWithCode ¶
func IPWithCode ¶
func IsBool ¶
IsBool is kept for API symmetry. For Go-typed inputs it is a no-op. (Type mismatches are typically caught during JSON decoding.)
func IsFalseWithCode ¶
func JSONWithCode ¶
func LenWithCode ¶
func LowercaseWithCode ¶
func MaxFloat64 ¶
func MaxFloat64WithCode ¶
func MaxItemsStr ¶
func MaxItemsStrWithCode ¶
func MaxLenWithCode ¶
func MinFloat64 ¶
func MinFloat64WithCode ¶
func MinItemsStr ¶
func MinItemsStrWithCode ¶
func MinLenWithCode ¶
func NotNilWithCode ¶
func NotRegexWithCode ¶
func OneOfWithCode ¶
func RegexWithCode ¶
func RequiredBoolWithCode ¶
func RequiredFieldWithCode ¶
func RequiredIntWithCode ¶
func RequiredOptBool ¶
func RequiredOptBool[T any](f form.OptBoolField[T]) form.Rule[T]
func RequiredOptBoolWithCode ¶
func RequiredOptInt ¶
func RequiredOptInt[T any](f form.OptIntField[T]) form.Rule[T]
func RequiredOptIntWithCode ¶
func RequiredOptStr ¶
func RequiredOptStr[T any](f form.OptStringField[T]) form.Rule[T]
func RequiredOptStrWithCode ¶
func RequiredOptTime ¶
func RequiredOptTime[T any](f form.OptTimeField[T]) form.Rule[T]
func RequiredOptTimeWithCode ¶
func RequiredSliceStr ¶
func RequiredSliceStr[T any](f form.SliceStringField[T]) form.Rule[T]
func RequiredStr ¶
func RequiredStr[T any](f form.StringField[T]) form.Rule[T]
func RequiredStrWithCode ¶
func RequiredTimeWithCode ¶
func RequiredWithCode ¶
func StartsWith ¶
func StartsWithWithCode ¶
func TimezoneWithCode ¶
func URLWithCode ¶
func UUIDWithCode ¶
func UppercaseWithCode ¶
Types ¶
type StrValueRule ¶
EachStr: validation of each element with indexing field[0], field[1]...
func VMinLen ¶
func VMinLen(n int) StrValueRule
func VMinLenWithCode ¶
func VMinLenWithCode(n int, code form.Code) StrValueRule
func VRegex ¶
func VRegex(re *regexp.Regexp) StrValueRule
func VRegexWithCode ¶
func VRegexWithCode(re *regexp.Regexp, code form.Code) StrValueRule
func VRequired ¶
func VRequired() StrValueRule
func VRequiredWithCode ¶
func VRequiredWithCode(code form.Code) StrValueRule
Click to show internal directories.
Click to hide internal directories.