Documentation ¶
Index ¶
- Constants
- func EmptyError() string
- func InclusiveRangeError(lo, hi int) string
- func IsDNS1123Label(value string) []string
- func IsDNS1123Subdomain(value string) []string
- func IsInRange(value int, min int, max int) []string
- func IsQualifiedName(value string) []string
- func IsValidIP(value string) []string
- func IsValidLabelValue(value string) []string
- func IsValidPassword(password string) error
- func IsValidPercent(percent string) []string
- func IsValidPortNum(port int) []string
- func MaxLenError(length int) string
- func RegexError(msg string, fmt string, examples ...string) string
- type Validator
Constants ¶
View Source
const DNS1123LabelMaxLength int = 63
DNS1123LabelMaxLength 是 DNS(RFC 1123)中标签的最大长度.
View Source
const DNS1123SubdomainMaxLength int = 253
DNS1123SubdomainMaxLength 是 DNS(RFC 1123)中子域的最大长度.
View Source
const LabelValueMaxLength int = 63
LabelValueMaxLength 是一个标签的最大长度.
Variables ¶
This section is empty.
Functions ¶
func IsDNS1123Label ¶
IsDNS1123Label 检查 value 是否是符合 DNS(RFC 1123)中标签定义的字符串.
func IsDNS1123Subdomain ¶
IsDNS1123Subdomain 检查 value 是否是符合 DNS(RFC 1123)中子域定义的字符串.
func IsQualifiedName ¶
IsQualifiedName 检查 value 是否是一个合法的名字.
func IsValidLabelValue ¶
IsValidLabelValue 检查 value 是否是一个合法的标签.
func IsValidPassword ¶
IsValidPassword 检查 password 是否是一个合法密码.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator is a custom validator for configs.
func NewValidator ¶
func NewValidator(data interface{}) *Validator
NewValidator creates a new Validator.
Click to show internal directories.
Click to hide internal directories.