rules

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2018 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Email

func Email(value []string, _ string) bool

*

  • 验证邮箱地址是否正确

func In added in v1.0.1

func In(value []string, arr string) bool

*

  • 判断字符串是否是数组中的某一项

func Int

func Int(value []string, _ string) bool

*

  • 判断传入职是否是整数 *
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Max

func Max(value []string, param string) bool

*

  • 字符串最大长度判断, 包括最大值本身 *
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Min

func Min(value []string, param string) bool

*

  • 字符串最小长度判断, 包括最小值 *
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Mobile

func Mobile(value []string, _ string) bool

*

  • 检测当前数据是否是有效手机号码
  • 仅支持大陆11位手机号,不支持座机号码

func Nullable

func Nullable(value []string, _ string) bool

*

  • 可选项不需要任何验证

func Numeric

func Numeric(value []string, _ string) bool

*

  • 验证字符串是否所有字符都是数字 *
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Regex

func Regex(value []string, pattern string) bool

*

  • 正则表达式验证 *
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Required

func Required(value []string, _ string) bool

*

  • 验证是否必填字符串
  • @param value 需要验证的值
  • @param param 自定义参数
  • @return bool

func Url

func Url(value []string, _ string) bool

*

  • 检测当前数据是否是有效Url地址

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL