Documentation ¶
Index ¶
- Constants
- func Params(c *gin.Context, v Validator) error
- func ValidLength(str, keyName string, minimum, maximum int) error
- func ValidateEmail(email string) bool
- func ValidateMobile(mobile string) bool
- type ValidateFunc
- func ValidateIP(value string, keyName string) ValidateFunc
- func ValidateIntRange(value int, keyName string, minimum, maximum int) ValidateFunc
- func ValidateRegexp(re *regexp.Regexp, str, keyName string) ValidateFunc
- func ValidateSameString(str1, keyName1, str2, keyName2 string) ValidateFunc
- func ValidateString(str, keyName string, minimum, maximum int) ValidateFunc
- func ValidateStringArrayOptions(strList []string, keyName string, options []string) ValidateFunc
- func ValidateStringOptions(str string, keyName string, options []string) ValidateFunc
- func ValidateStringPointer(str *string, keyName string, minimum, maximum int) ValidateFunc
- type ValidateWrapper
- type Validator
Constants ¶
View Source
const ( ItemEmptyLimit = 0 ItemNotEmptyLimit = 1 ItemNoLimit = 0 )
Variables ¶
This section is empty.
Functions ¶
func ValidLength ¶
func ValidateEmail ¶
func ValidateMobile ¶
Types ¶
type ValidateFunc ¶
type ValidateFunc func() error
func ValidateIP ¶
func ValidateIP(value string, keyName string) ValidateFunc
func ValidateIntRange ¶
func ValidateIntRange(value int, keyName string, minimum, maximum int) ValidateFunc
func ValidateRegexp ¶
func ValidateRegexp(re *regexp.Regexp, str, keyName string) ValidateFunc
func ValidateSameString ¶
func ValidateSameString(str1, keyName1, str2, keyName2 string) ValidateFunc
func ValidateString ¶
func ValidateString(str, keyName string, minimum, maximum int) ValidateFunc
func ValidateStringArrayOptions ¶
func ValidateStringArrayOptions(strList []string, keyName string, options []string) ValidateFunc
func ValidateStringOptions ¶
func ValidateStringOptions(str string, keyName string, options []string) ValidateFunc
func ValidateStringPointer ¶
func ValidateStringPointer(str *string, keyName string, minimum, maximum int) ValidateFunc
type ValidateWrapper ¶
type ValidateWrapper struct {
// contains filtered or unexported fields
}
func NewWrapper ¶
func NewWrapper(fns ...ValidateFunc) *ValidateWrapper
func (*ValidateWrapper) AddValidateFunc ¶
func (vw *ValidateWrapper) AddValidateFunc(functions ...ValidateFunc)
func (*ValidateWrapper) Validate ¶
func (vw *ValidateWrapper) Validate() error
Click to show internal directories.
Click to hide internal directories.