Documentation ¶
Index ¶
- Variables
- type Engine
- func (v *Engine) Bool() (bool, error)
- func (v *Engine) CamelCaseToSnakeCase(str string, delimiter ...string) *Engine
- func (v *Engine) Customize(fn func(rawValue string, err error) (newValue string, newErr error)) *Engine
- func (v *Engine) EnumFloat64(f []float64, customError ...string) *Engine
- func (v *Engine) EnumInt(i []int, customError ...string) *Engine
- func (v *Engine) EnumString(slice []string, customError ...string) *Engine
- func (v *Engine) Error() (err error)
- func (v *Engine) Float64() (float64, error)
- func (v *Engine) HasLetter(customError ...string) *Engine
- func (v *Engine) HasLower(customError ...string) *Engine
- func (v *Engine) HasNumber(customError ...string) *Engine
- func (v *Engine) HasPrefix(sub string, customError ...string) *Engine
- func (v *Engine) HasString(sub string, customError ...string) *Engine
- func (v *Engine) HasSuffix(sub string, customError ...string) *Engine
- func (v *Engine) HasSymbol(customError ...string) *Engine
- func (v *Engine) HasUpper(customError ...string) *Engine
- func (v *Engine) Int() (int, error)
- func (v *Engine) IsBool(customError ...string) *Engine
- func (v *Engine) IsChinese(customError ...string) *Engine
- func (v *Engine) IsChineseIDNumber(customError ...string) *Engine
- func (v *Engine) IsIP(customError ...string) *Engine
- func (v *Engine) IsJSON(customError ...string) *Engine
- func (v *Engine) IsLetter(customError ...string) *Engine
- func (v *Engine) IsLetterOrDigit(customError ...string) *Engine
- func (v *Engine) IsLower(customError ...string) *Engine
- func (v *Engine) IsLowerOrDigit(customError ...string) *Engine
- func (v *Engine) IsMail(customError ...string) *Engine
- func (v *Engine) IsMobile(customError ...string) *Engine
- func (v *Engine) IsNumber(customError ...string) *Engine
- func (v *Engine) IsURL(customError ...string) *Engine
- func (v *Engine) IsUpper(customError ...string) *Engine
- func (v *Engine) IsUpperOrDigit(customError ...string) *Engine
- func (v *Engine) MaxFloat(max float64, customError ...string) *Engine
- func (v *Engine) MaxInt(max int, customError ...string) *Engine
- func (v *Engine) MaxLength(max int, customError ...string) *Engine
- func (v *Engine) MaxUTF8Length(max int, customError ...string) *Engine
- func (v *Engine) MinFloat(min float64, customError ...string) *Engine
- func (v *Engine) MinInt(min int, customError ...string) *Engine
- func (v *Engine) MinLength(min int, customError ...string) *Engine
- func (v *Engine) MinUTF8Length(min int, customError ...string) *Engine
- func (v *Engine) Ok() bool
- func (v *Engine) Password(customError ...string) *Engine
- func (v *Engine) RemoveSpace() *Engine
- func (v *Engine) ReplaceAll(old, new string) *Engine
- func (v *Engine) Required(customError ...string) *Engine
- func (v *Engine) Result() (string, error)
- func (v *Engine) SnakeCaseToCamelCase(ucfirst bool, delimiter ...string) *Engine
- func (v *Engine) Split(sep string) ([]string, error)
- func (v *Engine) String() (string, error)
- func (v *Engine) StrongPassword(customError ...string) *Engine
- func (v *Engine) Trim() *Engine
- func (v *Engine) Value() (value string)
- func (v *Engine) Verifi(value string, name ...string) *Engine
- func (v *Engine) XssClean() *Engine
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoValidationValueSet = errors.New("未设置验证值")
)
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CamelCaseToSnakeCase ¶
CamelCaseToSnakeCase camelCase To SnakeCase helloWorld/HelloWorld => hello_world
func (*Engine) Customize ¶
func (v *Engine) Customize(fn func(rawValue string, err error) (newValue string, newErr error)) *Engine
Customize customize valid
func (*Engine) EnumFloat64 ¶
EnumFloat64 allow only values in []float64
func (*Engine) EnumString ¶
EnumString allow only values in []string
func (*Engine) IsChineseIDNumber ¶
IsChineseIDNumber mainland china id number
func (*Engine) IsLetterOrDigit ¶
IsLetterOrDigit letters or numbers
func (*Engine) IsLowerOrDigit ¶
IsLowerOrDigit lowercase letters or numbers
func (*Engine) IsUpperOrDigit ¶
IsUpperOrDigit uppercase letters or numbers
func (*Engine) MaxUTF8Length ¶
MaxUTF8Length utf8 encoding maximum length
func (*Engine) MinUTF8Length ¶
MinUTF8Length utf8 encoding minimum length
func (*Engine) Password ¶
Password Universal password (any visible character, length between 6 ~ 20)
func (*Engine) ReplaceAll ¶
ReplaceAll replace all
func (*Engine) Required ¶
Required Must have a value (zero values other than "" are allowed). If this rule is not used, when the parameter value is "", data validation does not take effect by default
func (*Engine) SnakeCaseToCamelCase ¶
SnakeCaseToCamelCase snakeCase To CamelCase: hello_world => helloWorld
func (*Engine) StrongPassword ¶
StrongPassword Strong equal strength password (length is 6 ~ 20, must include uppercase and lowercase letters, numbers and special characters)