Discover Packages
github.com/apptut/validator
rules
package
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Apr 10, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
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.
Opens a new window with list of known importers.
Jump to ...
Documentation
Index
Constants
Variables
Functions
Email(value, _)
Int(value, _)
Max(value, param)
Min(value, param)
Mobile(value, _)
Nullable(value, _)
Numeric(value, _)
Regex(value, pattern)
Required(value, _)
Url(value, _)
Types
Source Files
Documentation
Documentation
¶
func Email(value []string, _ string) bool
func Int(value []string, _ string) bool
func Max(value []string, param string) bool
func Min(value []string, param string) bool
func Mobile(value []string, _ string) bool
func Nullable(value []string, _ string) bool
func Numeric(value []string, _ string) bool
func Regex(value []string, pattern string) bool
func Required(value []string, _ string) bool
func Url(value []string, _ string) bool
*
判断传入职是否是整数
*
@param value 需要验证的值
@param param 自定义参数
@return bool
*
字符串最大长度判断, 包括最大值本身
*
@param value 需要验证的值
@param param 自定义参数
@return bool
*
字符串最小长度判断, 包括最小值
*
@param value 需要验证的值
@param param 自定义参数
@return bool
*
检测当前数据是否是有效手机号码
仅支持大陆11位手机号,不支持座机号码
*
验证字符串是否所有字符都是数字
*
@param value 需要验证的值
@param param 自定义参数
@return bool
*
正则表达式验证
*
@param value 需要验证的值
@param param 自定义参数
@return bool
*
验证是否必填字符串
@param value 需要验证的值
@param param 自定义参数
@return bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.