Documentation ¶
Index ¶
- Constants
- func EmptyError() string
- func InclusiveRangeError(lo, hi int) string
- func IsCIdentifier(value string) []string
- func IsConfigMapKey(value string) []string
- func IsDNS1035Label(value string) []string
- func IsDNS1123Label(value string) []string
- func IsDNS1123Subdomain(value string) []string
- func IsHTTPHeaderName(value string) []string
- func IsQualifiedName(value string) []string
- func IsValidGroupId(gid int64) []string
- func IsValidIP(value string) []string
- func IsValidLabelValue(value string) []string
- func IsValidPercent(percent string) []string
- func IsValidPortName(port string) []string
- func IsValidPortNum(port int) []string
- func IsValidUserId(uid int64) []string
- func IsWildcardDNS1123Subdomain(value string) []string
- func MaxLenError(length int) string
- func RegexError(fmt string, examples ...string) string
Constants ¶
const DNS1035LabelMaxLength int = 63
const DNS1123LabelMaxLength int = 63
const DNS1123SubdomainMaxLength int = 253
const LabelValueMaxLength int = 63
Variables ¶
This section is empty.
Functions ¶
func EmptyError ¶ added in v1.3.0
func EmptyError() string
EmptyError returns a string explanation of a "must not be empty" validation failure.
func InclusiveRangeError ¶ added in v1.4.0
InclusiveRangeError returns a string explanation of a numeric "must be between" validation failure.
func IsCIdentifier ¶
IsCIdentifier tests for a string that conforms the definition of an identifier in C. This checks the format, but not the length.
func IsConfigMapKey ¶ added in v1.4.0
IsConfigMapKey tests for a string that is a valid key for a ConfigMap or Secret
func IsDNS1035Label ¶ added in v1.4.0
IsDNS1035Label tests for a string that conforms to the definition of a label in DNS (RFC 1035).
func IsDNS1123Label ¶
IsDNS1123Label tests for a string that conforms to the definition of a label in DNS (RFC 1123).
func IsDNS1123Subdomain ¶
IsDNS1123Subdomain tests for a string that conforms to the definition of a subdomain in DNS (RFC 1123).
func IsHTTPHeaderName ¶ added in v1.2.0
IsHTTPHeaderName checks that a string conforms to the Go HTTP library's definition of a valid header field name (a stricter subset than RFC7230).
func IsQualifiedName ¶
IsQualifiedName tests whether the value passed is what Kubernetes calls a "qualified name". This is a format used in various places throughout the system. If the value is not valid, a list of error strings is returned. Otherwise an empty list (or nil) is returned.
func IsValidGroupId ¶ added in v1.2.0
IsValidGroupId tests that the argument is a valid Unix GID.
func IsValidLabelValue ¶
IsValidLabelValue tests whether the value passed is a valid label value. If the value is not valid, a list of error strings is returned. Otherwise an empty list (or nil) is returned.
func IsValidPercent ¶
func IsValidPortName ¶
IsValidPortName check that the argument is valid syntax. It must be non-empty and no more than 15 characters long. It may contain only [-a-z0-9] and must contain at least one letter [a-z]. It must not start or end with a hyphen, nor contain adjacent hyphens.
Note: We only allow lower-case characters, even though RFC 6335 is case insensitive.
func IsValidPortNum ¶
IsValidPortNum tests that the argument is a valid, non-zero port number.
func IsValidUserId ¶ added in v1.2.0
IsValidUserId tests that the argument is a valid Unix UID.
func IsWildcardDNS1123Subdomain ¶ added in v1.4.0
IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a wildcard subdomain in DNS (RFC 1034 section 4.3.3).
func MaxLenError ¶ added in v1.3.0
MaxLenError returns a string explanation of a "string too long" validation failure.
func RegexError ¶ added in v1.3.0
RegexError returns a string explanation of a regex validation failure.
Types ¶
This section is empty.