Documentation ¶
Index ¶
- func ContainsChinese(s string) bool
- func EmptyToDefault(str string, defaultStr string) string
- func HasEmpty(elems []interface{}) (bool, int)
- func IsAllEmpty(elems []interface{}) bool
- func IsEmptyValue(v reflect.Value) bool
- func IsUndefined(str string) bool
- func NotEmpty() string
- func RegisterRule(key string, rule Rules) error
- func Verify(st interface{}, roleMap Rules) error
- type Rules
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsChinese ¶
ContainsChinese checks if a string contains any Chinese characters.
func EmptyToDefault ¶
EmptyToDefault returns defaultStr if str is empty; otherwise, returns str.
func IsAllEmpty ¶
func IsAllEmpty(elems []interface{}) bool
IsAllEmpty checks if all elements in the slice are empty.
func IsEmptyValue ¶
isEmptyValue checks if a reflect.Value is empty.
func IsUndefined ¶
IsUndefined checks if a string is "undefined" (case insensitive).
func RegisterRule ¶
RegisterRule registers a custom validation rule.
Types ¶
Click to show internal directories.
Click to hide internal directories.