Documentation
¶
Index ¶
- Constants
- func InclusiveRangeError(lo, hi int) error
- func IsCIdentifier(value string) []string
- func IsDNS1035Label(value string) []string
- func IsDNS1123Label(value string) []string
- func IsDNS1123Subdomain(value string) []string
- func IsEnvVarName(value string) []string
- func IsHTTPHeaderName(value string) []string
- func IsInRange(value int, min int, max int) error
- func IsMapKeyName(value string) []string
- func IsValidGID(gid int64) error
- func IsValidIP(value string) []string
- func IsValidPercent(percent string) []string
- func IsValidPortName(port string) []string
- func IsValidPortNum(port int) error
- func IsValidUID(uid int64) error
- func IsValidateEmail(value string) error
- func IsWildcardDNS1123Subdomain(value string) []string
- func MaxLenError(length int) string
- func RegexError(msg string, fmt string, examples ...string) string
- func ValidateDockerVersion(version string) (string, string)
- func ValidateKernelVersion(version string) (string, string)
Constants ¶
const ( ValidatePage = "/validate/" Supported = "[Supported, but not recommended]" Unsupported = "[Unsupported]" Recommended = "[Supported and recommended]" Unknown = "[Unknown]" VersionFormat = "%d.%d%s" OutputFormat = "%s: %s\n\t%s\n\n" )
const DNS1035LabelMaxLength int = 63
const DNS1123LabelMaxLength int = 63
const DNS1123SubdomainMaxLength int = 253
Variables ¶
This section is empty.
Functions ¶
func InclusiveRangeError ¶
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 IsDNS1035Label ¶
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 IsEnvVarName ¶
IsEnvVarName tests if a string is a valid environment variable name.
func IsHTTPHeaderName ¶
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 IsMapKeyName ¶
IsMapKeyName tests for a string that is a valid key for a Map or Secret
func IsValidGID ¶
IsValidGID tests that the argument is a valid Unix GID.
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 IsValidUID ¶
IsValidUID tests that the argument is a valid Unix UID.
func IsValidateEmail ¶
func IsWildcardDNS1123Subdomain ¶
IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a wildcard subdomain in DNS (RFC 1034 section 4.3.3).
func MaxLenError ¶
MaxLenError returns a string explanation of a "string too long" validation failure.
func RegexError ¶
RegexError returns a string explanation of a regex validation failure.
func ValidateDockerVersion ¶
func ValidateKernelVersion ¶
Types ¶
This section is empty.