github.com/isyscore/isc-gobase@v1.5.3-0.20231218061332-cbc7451899e9/constants/validate_constant.go (about)

     1  package constants
     2  
     3  /* 匹配 */
     4  const (
     5  	// Value 值列表
     6  	Value = "value"
     7  	// IsBlank 字符为空匹配
     8  	IsBlank = "isBlank"
     9  	// IsUnBlank 字符为非空匹配
    10  	IsUnBlank = "isUnBlank"
    11  	// Range 范围匹配
    12  	Range = "range"
    13  	// Model 固定的几个模式匹配
    14  	Model = "model"
    15  	// Condition 条件表达式
    16  	Condition = "condition"
    17  	// Regex 正则表达式
    18  	Regex = "regex"
    19  	// Customize 自定义函数回调
    20  	Customize = "customize"
    21  )
    22  
    23  /* 匹配后处理 */
    24  const (
    25  	// ErrMsg 自定义错误异常
    26  	ErrMsg = "errMsg"
    27  	// Accept 匹配后是否接受
    28  	Accept = "accept"
    29  	// Disable 是否启用属性的核查功能
    30  	Disable = "disable"
    31  )
    32  
    33  /* tag关键字 */
    34  const (
    35  	EQUAL = "="
    36  	MATCH = "match"
    37  	CHECK = "check"
    38  )
    39  
    40  /* range匹配关键字 */
    41  const (
    42  	LeftEqual    = "["
    43  	LeftUnEqual  = "("
    44  	RightUnEqual = ")"
    45  	RightEqual   = "]"
    46  
    47  	Now    = "now"
    48  	Past   = "past"
    49  	Future = "future"
    50  )
    51  
    52  /* model类别 */
    53  const (
    54  	IdCard     = "id_card"
    55  	Phone      = "phone"
    56  	FixedPhone = "fixed_phone"
    57  	MAIL       = "mail"
    58  	IpAddress  = "ip"
    59  )