Documentation
¶
Overview ¶
Package validators contains built-in validators for parent package "github.com/s3rj1k/validator"
Index ¶
- Constants
- Variables
- func Exists(path string) bool
- func IsGroupIsUserGroupOrWhitelisted(name string, whitelist ...string) bool
- func IsUserIsRegularUserOrWhitelisted(name string, whitelist ...string) bool
- func NumFieldToString(field interface{}) string
- func ReadUserGIDRange(path string) (uint64, uint64)
- func ReadUserUIDRange(path string) (uint64, uint64)
- type ExecExitCodeHasAny
- type ExecExitCodeHasNoneOf
- type ExecExitCodeIsNotZero
- type ExecExitCodeIsZero
- type FuncValidator
- type Number
- type NumberInRange
- type NumberIsGreater
- type NumberIsLess
- type NumberIsNotZero
- type NumberIsValidUserGID
- type NumberIsValidUserUID
- type NumberSliceDive
- type NumberValidator
- type NumbersAreEqual
- type NumbersAreNotEqual
- type SliceIsNotEmpty
- type SliceIsUnique
- type SliceLengthInRange
- type StringContainsAny
- type StringContainsNoneOf
- type StringExclusion
- type StringHasAlpha
- type StringHasLowerCase
- type StringHasNoFileInPathParents
- type StringHasNoPrefix
- type StringHasNoSuffix
- type StringHasNoWhitespace
- type StringHasNumber
- type StringHasPrefix
- type StringHasPrefixAny
- type StringHasPrefixNoneOf
- type StringHasSuffix
- type StringHasSuffixAny
- type StringHasSuffixNoneOf
- type StringHasUpperCase
- type StringInclusion
- type StringIsASCII
- type StringIsAbsPath
- type StringIsAlpha
- type StringIsAlphaNum
- type StringIsBase64
- type StringIsCIDR
- type StringIsCIDRv4
- type StringIsCIDRv6
- type StringIsDir
- type StringIsDirWithModeSticky
- type StringIsDirWithoutModeSticky
- type StringIsEmail
- type StringIsEmailLike
- type StringIsExistingGroup
- type StringIsExistingUser
- type StringIsFile
- type StringIsFileAndIsExecutable
- type StringIsFileAndIsNotExecutable
- type StringIsFloat
- type StringIsHTTPURL
- type StringIsHash
- type StringIsHexadecimal
- type StringIsHexcolor
- type StringIsIP
- type StringIsIPGlobalUnicast
- type StringIsIPHasPTR
- type StringIsIPIfaceLocalMulticast
- type StringIsIPLinkLocalMulticast
- type StringIsIPLinkLocalUnicast
- type StringIsIPLoopback
- type StringIsIPMulticast
- type StringIsIPUnspec
- type StringIsIPv4
- type StringIsIPv6
- type StringIsInt
- type StringIsJSON
- type StringIsLowerCase
- type StringIsMAC
- type StringIsNotDir
- type StringIsNotExistingGroup
- type StringIsNotExistingUser
- type StringIsNotFile
- type StringIsNotNumeric
- type StringIsNotPath
- type StringIsNotRegularUser
- type StringIsNotResolvableHostname
- type StringIsNotResolvableHostnameNorIP
- type StringIsNotResolvableHostnameNorIPv4
- type StringIsNotResolvableHostnameNorIPv6
- type StringIsNotSymlink
- type StringIsNotUserGroup
- type StringIsNull
- type StringIsNumeric
- type StringIsPath
- type StringIsPathAndCharDevice
- type StringIsPathAndDevice
- type StringIsPathAndIrregularFile
- type StringIsPathAndIsWritable
- type StringIsPathAndNamedPipe
- type StringIsPathAndNotCharDevice
- type StringIsPathAndNotDevice
- type StringIsPathAndNotNamedPipe
- type StringIsPathAndNotSocket
- type StringIsPathAndRegularFile
- type StringIsPathAndSocket
- type StringIsPathWithSetGID
- type StringIsPathWithSetUID
- type StringIsPathWithoutSetGID
- type StringIsPathWithoutSetUID
- type StringIsPort
- type StringIsPresent
- type StringIsPrintableASCII
- type StringIsRGBcolor
- type StringIsRegularUserOrWhitelisted
- type StringIsResolvableHostname
- type StringIsResolvableHostnameOrIP
- type StringIsResolvableHostnameOrIPv4
- type StringIsResolvableHostnameOrIPv6
- type StringIsSymlink
- type StringIsSymlinkAndTargetIsDir
- type StringIsSymlinkAndTargetIsNotDir
- type StringIsSymlinkAndTargetIsNotPath
- type StringIsSymlinkAndTargetIsPath
- type StringIsUTFLetterNum
- type StringIsUTFLetters
- type StringIsUTFNumeric
- type StringIsUnixFilePermission
- type StringIsUpperCase
- type StringIsUserGroupOrWhitelisted
- type StringIsValidShadowPassword
- type StringIsValidUserOrGroupName
- type StringLengthInRange
- type StringMatchRegex
- type StringSliceDive
- type StringValidator
- type StringsAreEqual
- type StringsAreNotEqual
- type StringsArePathsInTheSameDir
- type StringsArePathsNotInTheSameDir
- type TimeIsAfterTime
- type TimeIsBeforeTime
- type TimeIsPresent
- type UUIDIsPresent
Constants ¶
const ( Email string = "" /* 1208-byte string literal not displayed */ Alpha string = "^[a-zA-Z]+$" Alphanumeric string = "^[a-zA-Z0-9]+$" Numeric string = "^[0-9]+$" Integer string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" Hexadecimal string = "^[0-9a-fA-F]+$" Hexcolor string = "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" RGBcolor string = "" /* 157-byte string literal not displayed */ ASCII string = "^[\x00-\x7F]+$" Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" PrintableASCII string = "^[\x20-\x7E]+$" Passwd string = "^[a-zA-Z0-9\\.\\/]+$" // nolint: gosec UserGroupName string = "^[a-z_][a-z0-9_-]*[$]?$" HasAlpha string = "[a-zA-Z]+" HasNumber string = "[0-9]+" UnixFilePermission string = "^0[1-7][0-7]{2,3}$" SetNameIndex string = `\[[0-9]+\]$` )
Basic regular expressions for validating strings nolint: lll
const (
// DefaultExecTimeoutSec is a default timeout for Exec validator group.
DefaultExecTimeoutSec = 60
)
Variables ¶
var ( // ErrBadNumType is an error for unsupported type provided to number validators ErrBadNumType = errors.New("unsupported type provided to number validator") // ErrBadSliceType is an error for unsupported type provided to slice validators ErrBadSliceType = errors.New("unsupported type provided to slice validator") // ErrNilValue is an error for encountering nil in validator ErrNilValue = errors.New("nil value must not be provided to validator") )
var ( // DefaultMinUserGID is a default value for MinUserGID, used then parsing of 'login.defs' fails. DefaultMinUserGID uint64 = 1000 // DefaultMaxUserGID is a default value for MaxUserGID, used then parsing of 'login.defs' fails. DefaultMaxUserGID uint64 = 60000 )
nolint: gochecknoglobals
var ( // DefaultMinUserUID is a default value for MinUserUID, used then parsing of 'login.defs' fails. DefaultMinUserUID uint64 = 1000 // DefaultMaxUserUID is a default value for MaxUserUID, used then parsing of 'login.defs' fails. DefaultMaxUserUID uint64 = 60000 )
nolint: gochecknoglobals
var ExecExitCodeHasAnyError = func(v *ExecExitCodeHasAny) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' after execution command must exit with any of defined status codes", strings.Join(v.Command, " ")) }
ExecExitCodeHasAnyError is a function that defines default error message returned by ExecExitCodeHasAny validator. nolint: gochecknoglobals
var ExecExitCodeHasNoneOfError = func(v *ExecExitCodeHasNoneOf) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' after execution command must exit with none of defined status codes", strings.Join(v.Command, " ")) }
ExecExitCodeHasNoneOfError is a function that defines default error message returned by ExecExitCodeHasNoneOf validator. nolint: gochecknoglobals
var ExecExitCodeIsNotZeroError = func(v *ExecExitCodeIsNotZero) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' after execution command must exit with none-zero status code", strings.Join(v.Command, " ")) }
ExecExitCodeIsNotZeroError is a function that defines default error message returned by ExecExitCodeIsNotZero validator. nolint: gochecknoglobals
var ExecExitCodeIsZeroError = func(v *ExecExitCodeIsZero) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' after execution command must exit with zero status code", strings.Join(v.Command, " ")) }
ExecExitCodeIsZeroError is a function that defines default error message returned by ExecExitCodeIsZero validator. nolint: gochecknoglobals
var FuncValidatorError = func(v *FuncValidator) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' failed custom func validation", v.Field) }
FuncValidatorError is a function that defines error message returned by FuncValidator validator. nolint: gochecknoglobals
var (
// LoginDefsPath is a default path to 'login.defs' file.
LoginDefsPath = "/etc/login.defs"
)
nolint: gochecknoglobals
var NumberInRangeError = func(v *NumberInRange) string { if len(v.Message) > 0 { return v.Message } e := fmt.Sprintf("'%s' not in range(%s, %s)", NumFieldToString(v.Field), NumFieldToString(v.Min), NumFieldToString(v.Max)) if v.CheckEqual { return fmt.Sprintf("%s (inclusive)", e) } return e }
NumberInRangeError is a function that defines error message returned by NumberInRange validator. nolint: gochecknoglobals
var NumberIsGreaterError = func(v *NumberIsGreater) string { if len(v.Message) > 0 { return v.Message } errt := "is not greater than" if v.CheckEqual { errt += " or equal to" } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' %s '%s'", NumFieldToString(v.Field), errt, NumFieldToString(v.ComparedField)) } return fmt.Sprintf("'%s' %s '%s'", v.Name, errt, v.ComparedName) }
NumberIsGreaterError is a function that defines error message returned by NumberIsGreater validator. nolint: gochecknoglobals
var NumberIsLessError = func(v *NumberIsLess) string { if len(v.Message) > 0 { return v.Message } errt := "is not less than" if v.CheckEqual { errt += " or equal to" } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' %s '%s'", NumFieldToString(v.Field), errt, NumFieldToString(v.ComparedField)) } return fmt.Sprintf("'%s' %s '%s'", v.Name, errt, v.ComparedName) }
NumberIsLessError is a function that defines error message returned by NumberIsLess validator. nolint: gochecknoglobals
var NumberIsNotZeroError = func(v *NumberIsNotZero) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must not be equal to 0", v.Name) }
NumberIsNotZeroError is a function that defines error message returned by NumberIsNotZero validator. nolint: gochecknoglobals
var NumberIsValidUserGIDError = func(v *NumberIsValidUserGID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid user GID", NumFieldToString(v.Field)) }
NumberIsValidUserGIDError is a function that defines error message returned by NumberIsValidUserGID validator. nolint: gochecknoglobals
var NumberIsValidUserUIDError = func(v *NumberIsValidUserUID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid user UID", NumFieldToString(v.Field)) }
NumberIsValidUserUIDError is a function that defines error message returned by NumberIsValidUserUID validator. nolint: gochecknoglobals
var NumbersAreEqualError = func(v *NumbersAreEqual) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' is not equal to '%s'", NumFieldToString(v.Field), NumFieldToString(v.ComparedField)) } return fmt.Sprintf("'%s' is not equal to '%s'", v.Name, v.ComparedName) }
NumbersAreEqualError is a function that defines error message returned by NumbersAreEqual validator. nolint: gochecknoglobals
var NumbersAreNotEqualError = func(v *NumbersAreNotEqual) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' is equal to '%s'", NumFieldToString(v.Field), NumFieldToString(v.ComparedField)) } return fmt.Sprintf("'%s' is equal to '%s'", v.Name, v.ComparedName) }
NumbersAreNotEqualError is a function that defines error message returned by NumbersAreNotEqual validator. nolint: gochecknoglobals
var SliceIsNotEmptyError = func(v *SliceIsNotEmpty) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' slice is empty", v.Name) }
SliceIsNotEmptyError is a function that defines error message returned by SliceIsNotEmpty validator. nolint: gochecknoglobals
var SliceIsUniqueError = func(v *SliceIsUnique) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("%v values are not unique", v.Field) }
SliceIsUniqueError is a function that defines error message returned by SliceIsUnique validator. nolint: gochecknoglobals
var SliceLengthInRangeError = func(v *SliceLengthInRange) string { if len(v.Message) > 0 { return v.Message } min := v.Min max := v.Max if max == 0 { max = v.length } if max == -1 { return fmt.Sprintf("%v is not empty", v.Field) } return fmt.Sprintf("%v length=%d not in range(%d, %d)", v.Field, v.length, min, max) }
SliceLengthInRangeError is a function that defines error message returned by SliceLengthInRange validator. nolint: gochecknoglobals
var StringContainsAnyError = func(v *StringContainsAny) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' does not contain any substrings from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' does not contain any substrings from '%s'", v.Name, v.ComparedName) }
StringContainsAnyError is a function that defines error message returned by StringContainsAny validator. nolint: gochecknoglobals
var StringContainsNoneOfError = func(v *StringContainsNoneOf) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' contains substring from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' contains substring from '%s'", v.Name, v.ComparedName) }
StringContainsNoneOfError is a function that defines error message returned by StringContainsNoneOf validator. nolint: gochecknoglobals
var StringExclusionError = func(v *StringExclusion) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("%s is in the blacklist %v", v.Name, v.Blacklist) }
StringExclusionError is a function that defines error message returned by StringExclusion validator. nolint: gochecknoglobals
var StringHasAlphaError = func(v *StringHasAlpha) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' has no letters", v.Field) }
StringHasAlphaError is a function that defines error message returned by StringHasAlpha validator. nolint: gochecknoglobals
var StringHasLowerCaseError = func(v *StringHasLowerCase) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain at least 1 lowercase", v.Field) }
StringHasLowerCaseError is a function that defines error message returned by StringHasLowerCase validator. nolint: gochecknoglobals
var StringHasNoFileInPathParentsError = func(v *StringHasNoFileInPathParents) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' contains path to a file", v.Field) }
StringHasNoFileInPathParentsError is a function that defines error message returned by StringHasNoFileInPathParents validator. nolint: gochecknoglobals
var StringHasNoPrefixError = func(v *StringHasNoPrefix) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' starts with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' starts with content of '%s'", v.Name, v.ComparedName) }
StringHasNoPrefixError is a function that defines error message returned by StringHasNoPrefix validator. nolint: gochecknoglobals
var StringHasNoSuffixError = func(v *StringHasNoSuffix) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' ends with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' ends with content of '%s'", v.Name, v.ComparedName) }
StringHasNoSuffixError is a function that defines error message returned by StringHasNoSuffix validator. nolint: gochecknoglobals
var StringHasNoWhitespaceError = func(v *StringHasNoWhitespace) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' has whitespace", v.Field) }
StringHasNoWhitespaceError is a function that defines error message returned by StringHasNoWhitespace validator. nolint: gochecknoglobals
var StringHasNumberError = func(v *StringHasNumber) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' has no numbers", v.Field) }
StringHasNumberError is a function that defines error message returned by StringHasNumber validator. nolint: gochecknoglobals
var StringHasPrefixAnyError = func(v *StringHasPrefixAny) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' has no prefix from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' has no prefix from contents of '%s'", v.Name, v.ComparedName) }
StringHasPrefixAnyError is a function that defines error message returned by StringHasPrefixAny validator. nolint: gochecknoglobals
var StringHasPrefixError = func(v *StringHasPrefix) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' does not start with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' does not start with content of '%s'", v.Name, v.ComparedName) }
StringHasPrefixError is a function that defines error message returned by StringHasPrefix validator. nolint: gochecknoglobals
var StringHasPrefixNoneOfError = func(v *StringHasPrefixNoneOf) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' has prefix from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' has prefix from contents of '%s'", v.Name, v.ComparedName) }
StringHasPrefixNoneOfError is a function that defines error message returned by StringHasPrefixNoneOf validator. nolint: gochecknoglobals
var StringHasSuffixAnyError = func(v *StringHasSuffixAny) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' has no suffix from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' has no suffix from contents of '%s'", v.Name, v.ComparedName) }
StringHasSuffixAnyError is a function that defines error message returned by StringHasSuffixAny validator. nolint: gochecknoglobals
var StringHasSuffixError = func(v *StringHasSuffix) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' does not end with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' does not end with content of '%s'", v.Name, v.ComparedName) }
StringHasSuffixError is a function that defines error message returned by StringHasSuffix validator. nolint: gochecknoglobals
var StringHasSuffixNoneOfError = func(v *StringHasSuffixNoneOf) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' has suffix from %v", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' has suffix from contents of '%s'", v.Name, v.ComparedName) }
StringHasSuffixNoneOfError is a function that defines error message returned by StringHasSuffixNoneOf validator. nolint: gochecknoglobals
var StringHasUpperCaseError = func(v *StringHasUpperCase) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain at least 1 uppercase", v.Field) }
StringHasUpperCaseError is a function that defines error message returned by StringHasUpperCase validator. nolint: gochecknoglobals
var StringInclusionError = func(v *StringInclusion) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not in the whitelist %v", v.Field, v.Whitelist) }
StringInclusionError is a function that defines error message returned by StringInclusion validator. nolint: gochecknoglobals
var StringIsASCIIError = func(v *StringIsASCII) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain ASCII chars only", v.Field) }
StringIsASCIIError is a function that defines error message returned by StringIsASCII validator. nolint: gochecknoglobals
var StringIsAbsPathError = func(v *StringIsAbsPath) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' must be absolute", v.Field) }
StringIsAbsPathError is a function that defines error message returned by StringIsAbsPath validator. nolint: gochecknoglobals
var StringIsAlphaError = func(v *StringIsAlpha) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only letters", v.Field) }
StringIsAlphaError is a function that defines error message returned by StringIsAlpha validator. nolint: gochecknoglobals
var StringIsAlphaNumError = func(v *StringIsAlphaNum) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only numbers and/or letters", v.Field) }
StringIsAlphaNumError is a function that defines error message returned by StringIsAlphaNum validator. nolint: gochecknoglobals
var StringIsBase64Error = func(v *StringIsBase64) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be base64 encoded", v.Field) }
StringIsBase64Error is a function that defines error message returned by StringIsBase64 validator. nolint: gochecknoglobals
var StringIsCIDRError = func(v *StringIsCIDR) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a CIDR notation address", v.Field) }
StringIsCIDRError is a function that defines error message returned by StringIsCIDR validator. nolint: gochecknoglobals
var StringIsCIDRv4Error = func(v *StringIsCIDRv4) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be CIDR notation of IPv4 address", v.Field) }
StringIsCIDRv4Error is a function that defines error message returned by StringIsCIDRv4 validator. nolint: gochecknoglobals
var StringIsCIDRv6Error = func(v *StringIsCIDRv6) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be CIDR notation of IPv6 address", v.Field) }
StringIsCIDRv6Error is a function that defines error message returned by StringIsCIDRv6 validator. nolint: gochecknoglobals
var StringIsDirError = func(v *StringIsDir) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' is not a dir", v.Field) }
StringIsDirError is a function that defines error message returned by StringIsDir validator. nolint: gochecknoglobals
var StringIsDirWithModeStickyError = func(v *StringIsDirWithModeSticky) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a dir or a dir without sticky mode", v.Field) }
StringIsDirWithModeStickyError is a function that defines error message returned by StringIsDirWithModeSticky validator. nolint: gochecknoglobals
var StringIsDirWithoutModeStickyError = func(v *StringIsDirWithoutModeSticky) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a dir or a dir with mode sticky", v.Field) }
StringIsDirWithoutModeStickyError is a function that defines error message returned by StringIsDirWithoutModeSticky validator. nolint: gochecknoglobals
var StringIsEmailError = func(v *StringIsEmail) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' does not match an email format", v.Field) }
StringIsEmailError is a function that defines error message returned by StringIsEmail validator. nolint: gochecknoglobals
var StringIsEmailLikeError = func(v *StringIsEmailLike) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("%s does not match an email-like format", v.Field) }
StringIsEmailLikeError is a function that defines error message returned by StringIsEmailLike validator. nolint: gochecknoglobals
var StringIsExistingGroupError = func(v *StringIsExistingGroup) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' user group does not exist", v.Field) }
StringIsExistingGroupError is a function that defines error message returned by StringIsExistingGroup validator. nolint: gochecknoglobals
var StringIsExistingUserError = func(v *StringIsExistingUser) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' user does not exist", v.Field) }
StringIsExistingUserError is a function that defines error message returned by StringIsExistingUser validator. nolint: gochecknoglobals
var StringIsFileAndIsExecutableError = func(v *StringIsFileAndIsExecutable) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' does not have execute bit set", v.Field) }
StringIsFileAndIsExecutableError is a function that defines error message returned by StringIsFileAndIsExecutable validator. nolint: gochecknoglobals
var StringIsFileAndIsNotExecutableError = func(v *StringIsFileAndIsNotExecutable) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' has execute bit set", v.Field) }
StringIsFileAndIsNotExecutableError is a function that defines error message returned by StringIsFileAndIsNotExecutable validator. nolint: gochecknoglobals
var StringIsFileError = func(v *StringIsFile) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a file", v.Field) }
StringIsFileError is a function that defines error message returned by StringIsFile validator. nolint: gochecknoglobals
var StringIsFloatError = func(v *StringIsFloat) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a float", v.Field) }
StringIsFloatError is a function that defines error message returned by StringIsFloat validator. nolint: gochecknoglobals
var StringIsHTTPURLError = func(v *StringIsHTTPURL) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid URL", v.Field) }
StringIsHTTPURLError is a function that defines error message returned by StringIsHTTPURL validator. nolint: gochecknoglobals
var StringIsHashError = func(v *StringIsHash) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid '%s' hash", v.Field, v.Algorithm) }
StringIsHashError is a function that defines error message returned by StringIsHash validator. nolint: gochecknoglobals
var StringIsHexadecimalError = func(v *StringIsHexadecimal) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a hexadecimal number", v.Field) }
StringIsHexadecimalError is a function that defines error message returned by StringIsHexadecimal validator. nolint: gochecknoglobals
var StringIsHexcolorError = func(v *StringIsHexcolor) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a hexadecimal color", v.Field) }
StringIsHexcolorError is a function that defines error message returned by StringIsHexcolor validator. nolint: gochecknoglobals
var StringIsIPError = func(v *StringIsIP) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be either IP version 4 or 6", v.Field) }
StringIsIPError is a function that defines error message returned by StringIsIP validator. nolint: gochecknoglobals
var StringIsIPGlobalUnicastError = func(v *StringIsIPGlobalUnicast) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be Global Unicast IP", v.Field) }
StringIsIPGlobalUnicastError is a function that defines error message returned by StringIsIPGlobalUnicast validator. nolint: gochecknoglobals
var StringIsIPHasPTRError = func(v *StringIsIPHasPTR) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be an IP address with resolvable PTR record", v.Field) }
StringIsIPHasPTRError is a function that defines error message returned by StringIsIPHasPTR validator. nolint: gochecknoglobals
var StringIsIPIfaceLocalMulticastError = func(v *StringIsIPIfaceLocalMulticast) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be an interface-local multicast address", v.Field) }
StringIsIPIfaceLocalMulticastError is a function that defines error message returned by StringIsIPIfaceLocalMulticast validator. nolint: gochecknoglobals
var StringIsIPLinkLocalMulticastError = func(v *StringIsIPLinkLocalMulticast) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a link-local multicast address", v.Field) }
StringIsIPLinkLocalMulticastError is a function that defines error message returned by StringIsIPLinkLocalMulticast validator. nolint: gochecknoglobals
var StringIsIPLinkLocalUnicastError = func(v *StringIsIPLinkLocalUnicast) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a link-local unicast address", v.Field) }
StringIsIPLinkLocalUnicastError is a function that defines error message returned by StringIsIPLinkLocalUnicast validator. nolint: gochecknoglobals
var StringIsIPLoopbackError = func(v *StringIsIPLoopback) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a loopback address", v.Field) }
StringIsIPLoopbackError is a function that defines error message returned by StringIsIPLoopback validator. nolint: gochecknoglobals
var StringIsIPMulticastError = func(v *StringIsIPMulticast) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a multicast address", v.Field) }
StringIsIPMulticastError is a function that defines error message returned by StringIsIPMulticast validator. nolint: gochecknoglobals
var StringIsIPUnspecError = func(v *StringIsIPUnspec) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be an unspecified address either IPv4 '0.0.0.0' or the IPv6 '::'", v.Field) }
StringIsIPUnspecError is a function that defines error message returned by StringIsIPUnspec validator. nolint: gochecknoglobals
var StringIsIPv4Error = func(v *StringIsIPv4) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be IPv4", v.Field) }
StringIsIPv4Error is a function that defines error message returned by StringIsIPv4 validator. nolint: gochecknoglobals
var StringIsIPv6Error = func(v *StringIsIPv6) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be IPv6", v.Field) }
StringIsIPv6Error is a function that defines error message returned by StringIsIPv6 validator. nolint: gochecknoglobals
var StringIsIntError = func(v *StringIsInt) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be an integer", v.Field) }
StringIsIntError is a function that defines error message returned by StringIsInt validator. nolint: gochecknoglobals
var StringIsJSONError = func(v *StringIsJSON) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a valid JSON", v.Field) }
StringIsJSONError is a function that defines error message returned by StringIsJSON validator. nolint: gochecknoglobals
var StringIsLowerCaseError = func(v *StringIsLowerCase) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be lowercased", v.Field) }
StringIsLowerCaseError is a function that defines error message returned by StringIsLowerCase validator. nolint: gochecknoglobals
var StringIsMACError = func(v *StringIsMAC) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be valid MAC address", v.Field) }
StringIsMACError is a function that defines error message returned by StringIsMAC validator. nolint: gochecknoglobals
var StringIsNotDirError = func(v *StringIsNotDir) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' is a dir", v.Field) }
StringIsNotDirError is a function that defines error message returned by StringIsNotDir validator. nolint: gochecknoglobals
var StringIsNotExistingGroupError = func(v *StringIsNotExistingGroup) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' user group exists", v.Field) }
StringIsNotExistingGroupError is a function that defines error message returned by StringIsNotExistingGroup validator. nolint: gochecknoglobals
var StringIsNotExistingUserError = func(v *StringIsNotExistingUser) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' user exists", v.Field) }
StringIsNotExistingUserError is a function that defines error message returned by StringIsNotExistingUser validator. nolint: gochecknoglobals
var StringIsNotFileError = func(v *StringIsNotFile) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a file", v.Field) }
StringIsNotFileError is a function that defines error message returned by StringIsNotFile validator. nolint: gochecknoglobals
var StringIsNotNumericError = func(v *StringIsNotNumeric) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is numeric", v.Field) }
StringIsNotNumericError is a function that defines error message returned by StringIsNotNumeric validator. nolint: gochecknoglobals
var StringIsNotPathError = func(v *StringIsNotPath) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' must not exist", v.Field) }
StringIsNotPathError is a function that defines error message returned by StringIsNotPath validator. nolint: gochecknoglobals
var StringIsNotRegularUserError = func(v *StringIsNotRegularUser) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a regular user", v.Field) }
StringIsNotRegularUserError is a function that defines error message returned by StringIsNotRegularUser validator. nolint: gochecknoglobals
var StringIsNotResolvableHostnameError = func(v *StringIsNotResolvableHostname) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a resolvable hostname", v.Field) }
StringIsNotResolvableHostnameError is a function that defines error message returned by StringIsNotResolvableHostname validator. nolint: gochecknoglobals
var StringIsNotResolvableHostnameNorIPError = func(v *StringIsNotResolvableHostnameNorIP) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a resolvable hostname or an IP address", v.Field) }
StringIsNotResolvableHostnameNorIPError is a function that defines error message returned by StringIsNotResolvableHostnameNorIP validator. nolint: gochecknoglobals
var StringIsNotResolvableHostnameNorIPv4Error = func(v *StringIsNotResolvableHostnameNorIPv4) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a resolvable hostname or an IPv4 address", v.Field) }
StringIsNotResolvableHostnameNorIPv4Error is a function that defines error message returned by StringIsNotResolvableHostnameNorIPv4 validator. nolint: gochecknoglobals
var StringIsNotResolvableHostnameNorIPv6Error = func(v *StringIsNotResolvableHostnameNorIPv6) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a resolvable hostname or an IPv6 address", v.Field) }
StringIsNotResolvableHostnameNorIPv6Error is a function that defines error message returned by StringIsNotResolvableHostnameNorIPv6 validator. nolint: gochecknoglobals
var StringIsNotSymlinkError = func(v *StringIsNotSymlink) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' is a symlink", v.Field) }
StringIsNotSymlinkError is a function that defines error message returned by StringIsNotSymlink validator. nolint: gochecknoglobals
var StringIsNotUserGroupError = func(v *StringIsNotUserGroup) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is a user group", v.Field) }
StringIsNotUserGroupError is a function that defines error message returned by StringIsNotUserGroup validator. nolint: gochecknoglobals
var StringIsNullError = func(v *StringIsNull) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be empty", v.Field) }
StringIsNullError is a function that defines error message returned by StringIsNull validator. nolint: gochecknoglobals
var StringIsNumericError = func(v *StringIsNumeric) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only numbers", v.Field) }
StringIsNumericError is a function that defines error message returned by StringIsNumeric validator. nolint: gochecknoglobals
var StringIsPathAndCharDeviceError = func(v *StringIsPathAndCharDevice) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without CharDevice mode", v.Field) }
StringIsPathAndCharDeviceError is a function that defines error message returned by StringIsPathAndCharDevice validator. nolint: gochecknoglobals
var StringIsPathAndDeviceError = func(v *StringIsPathAndDevice) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without Device mode", v.Field) }
StringIsPathAndDeviceError is a function that defines error message returned by StringIsPathAndDevice validator. nolint: gochecknoglobals
var StringIsPathAndIrregularFileError = func(v *StringIsPathAndIrregularFile) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without Irregular mode", v.Field) }
StringIsPathAndIrregularFileError is a function that defines error message returned by StringIsPathAndIrregularFile validator. nolint: gochecknoglobals
var StringIsPathAndIsWritableError = func(v *StringIsPathAndIsWritable) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' path is not writable", v.Field) }
StringIsPathAndIsWritableError is a function that defines error message returned by StringIsPathAndIsWritable validator. nolint: gochecknoglobals
var StringIsPathAndNamedPipeError = func(v *StringIsPathAndNamedPipe) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without NamedPipe mode", v.Field) }
StringIsPathAndNamedPipeError is a function that defines error message returned by StringIsPathAndNamedPipe validator. nolint: gochecknoglobals
var StringIsPathAndNotCharDeviceError = func(v *StringIsPathAndNotCharDevice) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with CharDevice mode", v.Field) }
StringIsPathAndNotCharDeviceError is a function that defines error message returned by StringIsPathAndNotCharDevice validator. nolint: gochecknoglobals
var StringIsPathAndNotDeviceError = func(v *StringIsPathAndNotDevice) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with Device mode", v.Field) }
StringIsPathAndNotDeviceError is a function that defines error message returned by StringIsPathAndNotDevice validator. nolint: gochecknoglobals
var StringIsPathAndNotNamedPipeError = func(v *StringIsPathAndNotNamedPipe) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with NamedPipe mode", v.Field) }
StringIsPathAndNotNamedPipeError is a function that defines error message returned by StringIsPathAndNotNamedPipe validator. nolint: gochecknoglobals
var StringIsPathAndNotSocketError = func(v *StringIsPathAndNotSocket) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with Socket mode", v.Field) }
StringIsPathAndNotSocketError is a function that defines error message returned by StringIsPathAndNotSocket validator. nolint: gochecknoglobals
var StringIsPathAndRegularFileError = func(v *StringIsPathAndRegularFile) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing non-regular file", v.Field) }
StringIsPathAndRegularFileError is a function that defines error message returned by StringIsPathAndRegularFile validator. nolint: gochecknoglobals
var StringIsPathAndSocketError = func(v *StringIsPathAndSocket) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without Socket mode", v.Field) }
StringIsPathAndSocketError is a function that defines error message returned by StringIsPathAndSocket validator. nolint: gochecknoglobals
var StringIsPathError = func(v *StringIsPath) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' must exist", v.Field) }
StringIsPathError is a function that defines error message returned by StringIsPath validator. nolint: gochecknoglobals
var StringIsPathWithSetGIDError = func(v *StringIsPathWithSetGID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without SetGID flag", v.Field) }
StringIsPathWithSetGIDError is a function that defines error message returned by StringIsPathWithSetGID validator. nolint: gochecknoglobals
var StringIsPathWithSetUIDError = func(v *StringIsPathWithSetUID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path without SetUID flag", v.Field) }
StringIsPathWithSetUIDError is a function that defines error message returned by StringIsPathWithSetUID validator. nolint: gochecknoglobals
var StringIsPathWithoutSetGIDError = func(v *StringIsPathWithoutSetGID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with SetGID flag", v.Field) }
StringIsPathWithoutSetGIDError is a function that defines error message returned by StringIsPathWithoutSetGID validator. nolint: gochecknoglobals
var StringIsPathWithoutSetUIDError = func(v *StringIsPathWithoutSetUID) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not an existing path or is an existing path with SetGID flag", v.Field) }
StringIsPathWithoutSetUIDError is a function that defines error message returned by StringIsPathWithoutSetUID validator. nolint: gochecknoglobals
var StringIsPortError = func(v *StringIsPort) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid port", v.Field) }
StringIsPortError is a function that defines error message returned by StringIsPort validator. nolint: gochecknoglobals
var StringIsPresentError = func(v *StringIsPresent) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must not be blank", v.Name) }
StringIsPresentError is a function that defines error message returned by StringIsPresent validator. nolint: gochecknoglobals
var StringIsPrintableASCIIError = func(v *StringIsPrintableASCII) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain printable ASCII chars only", v.Field) }
StringIsPrintableASCIIError is a function that defines error message returned by StringIsPrintableASCII validator. nolint: gochecknoglobals
var StringIsRGBcolorError = func(v *StringIsRGBcolor) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be a RGB color in format rgb(RRR, GGG, BBB)", v.Field) }
StringIsRGBcolorError is a function that defines error message returned by StringIsRGBcolor validator. nolint: gochecknoglobals
var StringIsRegularUserOrWhitelistedError = func(v *StringIsRegularUserOrWhitelisted) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a regular user or whitelisted", v.Field) }
StringIsRegularUserOrWhitelistedError is a function that defines error message returned by StringIsRegularUserOrWhitelisted validator. nolint: gochecknoglobals
var StringIsResolvableHostnameError = func(v *StringIsResolvableHostname) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a resolvable hostname", v.Field) }
StringIsResolvableHostnameError is a function that defines error message returned by StringIsResolvableHostname validator. nolint: gochecknoglobals
var StringIsResolvableHostnameOrIPError = func(v *StringIsResolvableHostnameOrIP) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a resolvable hostname and not an IP address", v.Field) }
StringIsResolvableHostnameOrIPError is a function that defines error message returned by StringIsResolvableHostnameOrIP validator. nolint: gochecknoglobals
var StringIsResolvableHostnameOrIPv4Error = func(v *StringIsResolvableHostnameOrIPv4) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a resolvable hostname and not an IPv4 address", v.Field) }
StringIsResolvableHostnameOrIPv4Error is a function that defines error message returned by StringIsResolvableHostnameOrIPv4 validator. nolint: gochecknoglobals
var StringIsResolvableHostnameOrIPv6Error = func(v *StringIsResolvableHostnameOrIPv6) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a resolvable hostname and not an IPv6 address", v.Field) }
StringIsResolvableHostnameOrIPv6Error is a function that defines error message returned by StringIsResolvableHostnameOrIPv6 validator. nolint: gochecknoglobals
var StringIsSymlinkAndTargetIsDirError = func(v *StringIsSymlinkAndTargetIsDir) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("symlink's '%s' target is not a directory", v.Field) }
StringIsSymlinkAndTargetIsDirError is a function that defines error message returned by StringIsSymlinkAndTargetIsDir validator. nolint: gochecknoglobals
var StringIsSymlinkAndTargetIsNotDirError = func(v *StringIsSymlinkAndTargetIsNotDir) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("symlink's '%s' target is a directory", v.Field) }
StringIsSymlinkAndTargetIsNotDirError is a function that defines error message returned by StringIsSymlinkAndTargetIsNotDir validator. nolint: gochecknoglobals
var StringIsSymlinkAndTargetIsNotPathError = func(v *StringIsSymlinkAndTargetIsNotPath) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("symlink's '%s' target is an existing path", v.Field) }
StringIsSymlinkAndTargetIsNotPathError is a function that defines error message returned by StringIsSymlinkAndTargetIsNotPath validator. nolint: gochecknoglobals
var StringIsSymlinkAndTargetIsPathError = func(v *StringIsSymlinkAndTargetIsPath) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("symlink's '%s' target is not an existing path", v.Field) }
StringIsSymlinkAndTargetIsPathError is a function that defines error message returned by StringIsSymlinkAndTargetIsPath validator. nolint: gochecknoglobals
var StringIsSymlinkError = func(v *StringIsSymlink) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("path '%s' is not a symlink", v.Field) }
StringIsSymlinkError is a function that defines error message returned by StringIsSymlink validator. nolint: gochecknoglobals
var StringIsUTFLetterNumError = func(v *StringIsUTFLetterNum) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only unicode letter/number characters", v.Field) }
StringIsUTFLetterNumError is a function that defines error message returned by StringIsUTFLetterNum validator. nolint: gochecknoglobals
var StringIsUTFLettersError = func(v *StringIsUTFLetters) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only unicode letter characters", v.Field) }
StringIsUTFLettersError is a function that defines error message returned by StringIsUTFLetters validator. nolint: gochecknoglobals
var StringIsUTFNumericError = func(v *StringIsUTFNumeric) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must contain only unicode numbers", v.Field) }
StringIsUTFNumericError is a function that defines error message returned by StringIsUTFNumeric validator. nolint: gochecknoglobals
var StringIsUnixFilePermissionError = func(v *StringIsUnixFilePermission) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a unix file permission", v.Field) }
StringIsUnixFilePermissionError is a function that defines error message returned by StringIsUnixFilePermission validator. nolint: gochecknoglobals
var StringIsUpperCaseError = func(v *StringIsUpperCase) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must be uppercased", v.Field) }
StringIsUpperCaseError is a function that defines error message returned by StringIsUpperCase validator. nolint: gochecknoglobals
var StringIsUserGroupOrWhitelistedError = func(v *StringIsUserGroupOrWhitelisted) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a user group or whitelisted", v.Field) }
StringIsUserGroupOrWhitelistedError is a function that defines error message returned by StringIsUserGroupOrWhitelisted validator. nolint: gochecknoglobals
var StringIsValidShadowPasswordError = func(v *StringIsValidShadowPassword) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid shadow password", v.Field) }
StringIsValidShadowPasswordError is a function that defines error message returned by StringIsValidShadowPassword validator. nolint: gochecknoglobals
var StringIsValidUserOrGroupNameError = func(v *StringIsValidUserOrGroupName) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' is not a valid user or group name", v.Field) }
StringIsValidUserOrGroupNameError is a function that defines error message returned by StringIsValidUserOrGroupName validator. nolint: gochecknoglobals
var StringLengthInRangeError = func(v *StringLengthInRange) string { if len(v.Message) > 0 { return v.Message } min := v.Min max := v.Max strLength := utf8.RuneCountInString(v.Field) if max == 0 { max = strLength } return fmt.Sprintf("'%s' not in range(%d, %d)", v.Field, min, max) }
StringLengthInRangeError is a function that defines error message returned by StringLengthInRange validator. nolint: gochecknoglobals
var StringMatchRegexError = func(v *StringMatchRegex) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' does not match regex '%s'", v.Field, v.Regex) }
StringMatchRegexError is a function that defines error message returned by StringMatchRegex validator. nolint: gochecknoglobals
var StringsAreEqualError = func(v *StringsAreEqual) string { if len(v.Message) > 0 { return v.Message } var caseName string if v.CaseInsensitive { caseName = "iequal" } else { caseName = "equal" } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' does not %s '%s'", v.Field, caseName, v.ComparedField) } return fmt.Sprintf("'%s' does not %s '%s'", v.Name, caseName, v.ComparedName) }
StringsAreEqualError is a function that defines error message returned by StringsAreEqual validator. nolint: gochecknoglobals
var StringsAreNotEqualError = func(v *StringsAreNotEqual) string { if len(v.Message) > 0 { return v.Message } var caseName string if v.CaseInsensitive { caseName = "iequal" } else { caseName = "equal" } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' is %s to '%s'", v.Field, caseName, v.ComparedField) } return fmt.Sprintf("'%s' is %s to '%s'", v.Name, caseName, v.ComparedName) }
StringsAreNotEqualError is a function that defines error message returned by StringsAreNotEqual validator. nolint: gochecknoglobals
var StringsArePathsInTheSameDirError = func(v *StringsArePathsInTheSameDir) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' path is not in the same dir with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' path is not in the same dir with '%s'", v.Name, v.ComparedName) }
StringsArePathsInTheSameDirError is a function that defines error message returned by StringsArePathsInTheSameDir validator. nolint: gochecknoglobals
var StringsArePathsNotInTheSameDirError = func(v *StringsArePathsNotInTheSameDir) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' path is in the same dir with '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' path is in the same dir with '%s'", v.Name, v.ComparedName) }
StringsArePathsNotInTheSameDirError is a function that defines error message returned by StringsArePathsNotInTheSameDir validator. nolint: gochecknoglobals
var TimeIsAfterTimeError = func(v *TimeIsAfterTime) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' must be after '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' must be after '%s'", v.Name, v.ComparedName) }
TimeIsAfterTimeError is a function that defines error message returned by TimeIsAfterTime validator. nolint: gochecknoglobals
var TimeIsBeforeTimeError = func(v *TimeIsBeforeTime) string { if len(v.Message) > 0 { return v.Message } if len(v.ComparedName) == 0 { return fmt.Sprintf("'%s' must be before '%s'", v.Field, v.ComparedField) } return fmt.Sprintf("'%s' must be before '%s'", v.Name, v.ComparedName) }
TimeIsBeforeTimeError is a function that defines error message returned by TimeIsBeforeTime validator. nolint: gochecknoglobals
var TimeIsPresentError = func(v *TimeIsPresent) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must not be blank", v.Name) }
TimeIsPresentError is a function that defines error message returned by TimeIsPresent validator. nolint: gochecknoglobals
var UUIDIsPresentError = func(v *UUIDIsPresent) string { if len(v.Message) > 0 { return v.Message } return fmt.Sprintf("'%s' must not be blank", v.Name) }
UUIDIsPresentError is a function that defines error message returned by UUIDIsPresent validator. nolint: gochecknoglobals
Functions ¶
func IsGroupIsUserGroupOrWhitelisted ¶
IsGroupIsUserGroupOrWhitelisted checkes if name is an allowed name of group
func IsUserIsRegularUserOrWhitelisted ¶
IsUserIsRegularUserOrWhitelisted checkes if user is regular (non-system or unclassified) user.
func NumFieldToString ¶
func NumFieldToString(field interface{}) string
NumFieldToString returns string representation of number field
func ReadUserGIDRange ¶
ReadUserGIDRange parses 'login.defs' file.
func ReadUserUIDRange ¶
ReadUserUIDRange parses 'login.defs' file.
Types ¶
type ExecExitCodeHasAny ¶
type ExecExitCodeHasAny struct { Name string Command []string Message string ExitCodes []int TimeoutSeconds int64 }
ExecExitCodeHasAny is a validator object. Validate adds an error if the Command value after execution returns with non of defined status codes.
func (*ExecExitCodeHasAny) Validate ¶
func (v *ExecExitCodeHasAny) Validate(e *validator.Errors)
Validate adds an error if the Command value after execution returns with non of defined status codes.
type ExecExitCodeHasNoneOf ¶
type ExecExitCodeHasNoneOf struct { Name string Command []string Message string ExitCodes []int TimeoutSeconds int64 }
ExecExitCodeHasNoneOf is a validator object. Validate adds an error if the Command value after execution returns with any of defined status codes.
func (*ExecExitCodeHasNoneOf) Validate ¶
func (v *ExecExitCodeHasNoneOf) Validate(e *validator.Errors)
Validate adds an error if the Command value after execution returns with any of defined status codes.
type ExecExitCodeIsNotZero ¶
type ExecExitCodeIsNotZero struct { Name string Command []string Message string TimeoutSeconds int64 }
ExecExitCodeIsNotZero is a validator object. Validate adds an error if the Command value after execution returns zero exit code.
func (*ExecExitCodeIsNotZero) Validate ¶
func (v *ExecExitCodeIsNotZero) Validate(e *validator.Errors)
Validate adds an error if the Command value after execution returns zero exit code.
type ExecExitCodeIsZero ¶
ExecExitCodeIsZero is a validator object. Validate adds an error if the Command value after execution returns non-zero exit code.
func (*ExecExitCodeIsZero) Validate ¶
func (v *ExecExitCodeIsZero) Validate(e *validator.Errors)
Validate adds an error if the Command value after execution returns non-zero exit code.
type FuncValidator ¶
type FuncValidator struct { Fn func(interface{}) bool Name string Field interface{} Message string }
FuncValidator is a validator object.
func (*FuncValidator) Validate ¶
func (v *FuncValidator) Validate(e *validator.Errors)
Validate is a validation method wrapper.
type Number ¶
type Number struct { Value uint64 // contains filtered or unexported fields }
Number represents a casted integer
type NumberInRange ¶
type NumberInRange struct { Name string Field interface{} Min interface{} Max interface{} CheckEqual bool Message string }
NumberInRange is a validator object. Validate adds an error if the Field is not in range between Min and Max (inclusive). Empty Min/Max values will be treated as 0 (zeros).
func (*NumberInRange) GetName ¶
func (v *NumberInRange) GetName() string
GetName is a getter on Name field.
func (*NumberInRange) SetField ¶
func (v *NumberInRange) SetField(s interface{})
SetField sets validator field.
func (*NumberInRange) SetNameIndex ¶
func (v *NumberInRange) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberInRange) Validate ¶
func (v *NumberInRange) Validate(e *validator.Errors)
Validate adds an error if the Field is not in range between Min and Max (inclusive). Empty Min/Max values will be treated as 0 (zeros).
type NumberIsGreater ¶
type NumberIsGreater struct { Name string Field interface{} ComparedName string ComparedField interface{} CheckEqual bool Message string }
NumberIsGreater is a validator object. Validate adds an error if the Field is not greater than the ComparedField.
func (*NumberIsGreater) GetName ¶
func (v *NumberIsGreater) GetName() string
GetName is a getter on Name field.
func (*NumberIsGreater) SetField ¶
func (v *NumberIsGreater) SetField(s interface{})
SetField sets validator field.
func (*NumberIsGreater) SetNameIndex ¶
func (v *NumberIsGreater) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberIsGreater) Validate ¶
func (v *NumberIsGreater) Validate(e *validator.Errors)
Validate adds an error if the Field is not greater than the ComparedField.
type NumberIsLess ¶
type NumberIsLess struct { Name string Field interface{} ComparedName string ComparedField interface{} CheckEqual bool Message string }
NumberIsLess is a validator object. Validate adds an error if the Field is not less than the ComparedField.
func (*NumberIsLess) GetName ¶
func (v *NumberIsLess) GetName() string
GetName is a getter on Name field.
func (*NumberIsLess) SetField ¶
func (v *NumberIsLess) SetField(s interface{})
SetField sets validator field.
func (*NumberIsLess) SetNameIndex ¶
func (v *NumberIsLess) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberIsLess) Validate ¶
func (v *NumberIsLess) Validate(e *validator.Errors)
Validate adds an error if the Field is not less than the ComparedField.
type NumberIsNotZero ¶
NumberIsNotZero is a validator object. Validate adds an error if the Field equals to 0.
func (*NumberIsNotZero) GetName ¶
func (v *NumberIsNotZero) GetName() string
GetName is a getter on Name field.
func (*NumberIsNotZero) SetField ¶
func (v *NumberIsNotZero) SetField(s interface{})
SetField sets validator field.
func (*NumberIsNotZero) SetNameIndex ¶
func (v *NumberIsNotZero) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberIsNotZero) Validate ¶
func (v *NumberIsNotZero) Validate(e *validator.Errors)
Validate adds an error if the Field equals to 0.
type NumberIsValidUserGID ¶
NumberIsValidUserGID is a validator object. Validate adds an error if the Field is in range of GID_MIN, GID_MAX from '/etc/login.defs'.
func (*NumberIsValidUserGID) GetName ¶
func (v *NumberIsValidUserGID) GetName() string
GetName is a getter on Name field.
func (*NumberIsValidUserGID) SetField ¶
func (v *NumberIsValidUserGID) SetField(s interface{})
SetField sets validator field.
func (*NumberIsValidUserGID) SetNameIndex ¶
func (v *NumberIsValidUserGID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberIsValidUserGID) Validate ¶
func (v *NumberIsValidUserGID) Validate(e *validator.Errors)
Validate adds an error if the Field is in range of GID_MIN, GID_MAX from '/etc/login.defs'.
type NumberIsValidUserUID ¶
NumberIsValidUserUID is a validator object. Validate adds an error if the Field is in range of UID_MIN, UID_MAX from '/etc/login.defs'.
func (*NumberIsValidUserUID) GetName ¶
func (v *NumberIsValidUserUID) GetName() string
GetName is a getter on Name field.
func (*NumberIsValidUserUID) SetField ¶
func (v *NumberIsValidUserUID) SetField(s interface{})
SetField sets validator field.
func (*NumberIsValidUserUID) SetNameIndex ¶
func (v *NumberIsValidUserUID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumberIsValidUserUID) Validate ¶
func (v *NumberIsValidUserUID) Validate(e *validator.Errors)
Validate adds an error if the Field is in range of UID_MIN, UID_MAX from '/etc/login.defs'.
type NumberSliceDive ¶
type NumberSliceDive struct { Validator NumberValidator Field interface{} }
NumberSliceDive is a validator object. Validate applies Validator to each value in the Field.
func (*NumberSliceDive) Validate ¶
func (v *NumberSliceDive) Validate(e *validator.Errors)
Validate applies Validator to each value in the Field.
type NumberValidator ¶
type NumberValidator interface { Validate(*validator.Errors) SetField(interface{}) SetNameIndex(int) GetName() string }
NumberValidator is an interface for string validator objects.
type NumbersAreEqual ¶
type NumbersAreEqual struct { Name string Field interface{} ComparedName string ComparedField interface{} Message string }
NumbersAreEqual is a validator object. Validate adds an error if the Field is not equal to the ComparedField.
func (*NumbersAreEqual) GetName ¶
func (v *NumbersAreEqual) GetName() string
GetName is a getter on Name field.
func (*NumbersAreEqual) SetField ¶
func (v *NumbersAreEqual) SetField(s interface{})
SetField sets validator field.
func (*NumbersAreEqual) SetNameIndex ¶
func (v *NumbersAreEqual) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumbersAreEqual) Validate ¶
func (v *NumbersAreEqual) Validate(e *validator.Errors)
Validate adds an error if the Field is not equal to the ComparedField.
type NumbersAreNotEqual ¶
type NumbersAreNotEqual struct { Name string Field interface{} ComparedName string ComparedField interface{} Message string }
NumbersAreNotEqual is a validator object. Validate adds an error if the Field is equal to the ComparedField.
func (*NumbersAreNotEqual) GetName ¶
func (v *NumbersAreNotEqual) GetName() string
GetName is a getter on Name field.
func (*NumbersAreNotEqual) SetField ¶
func (v *NumbersAreNotEqual) SetField(s interface{})
SetField sets validator field.
func (*NumbersAreNotEqual) SetNameIndex ¶
func (v *NumbersAreNotEqual) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*NumbersAreNotEqual) Validate ¶
func (v *NumbersAreNotEqual) Validate(e *validator.Errors)
Validate adds an error if the Field is equal to the ComparedField.
type SliceIsNotEmpty ¶
SliceIsNotEmpty is a validator object. Validate adds an error if the slice in Field is empty. Standard check adds an error if the slice is nil or of unsupported type. Supports all Go basic types except for bool.
func (*SliceIsNotEmpty) Validate ¶
func (v *SliceIsNotEmpty) Validate(e *validator.Errors)
Validate adds an error if the slice in Field is empty. Standard check adds an error if the slice is nil or of unsupported type. Supports all Go basic types except for bool. nolint: gocyclo
type SliceIsUnique ¶
SliceIsUnique is a validator object. Validate adds an error if the slice in Field has not unique values. Supports all Go basic types except for bool.
func (*SliceIsUnique) Validate ¶
func (v *SliceIsUnique) Validate(e *validator.Errors)
Validate adds an error if the slice in Field has not unique values. Supports all Go basic types except for bool. nolint: gocyclo
type SliceLengthInRange ¶
type SliceLengthInRange struct { Name string Field interface{} Min int Max int Message string // contains filtered or unexported fields }
SliceLengthInRange is a validator object. Validate adds an error if the slice in Field is not in range between Min and Max (inclusive). User can provide either both or only Min/Max fields. If only Min provided - Max=length of slice. If only Max provided - Min=0. Max=-1 -> slice must be empty. Standard check adds an error if the slice is nil or of unsupported type.
func (*SliceLengthInRange) Validate ¶
func (v *SliceLengthInRange) Validate(e *validator.Errors)
Validate adds an error if the slice in Field is not in range between Min and Max (inclusive). User can provide either both or only Min/Max fields. If only Min provided - Max=length of slice. If only Max provided - Min=0. Max=-1 -> slice must be empty. Standard check adds an error if the slice is nil or of unsupported type. nolint: gocyclo
type StringContainsAny ¶
type StringContainsAny struct { Name string Field string ComparedName string ComparedField []string Message string }
StringContainsAny is a validator object. Validate adds an error if the Field does not contain at least one substrings from ComparedField.
func (*StringContainsAny) SetField ¶
func (v *StringContainsAny) SetField(s string)
SetField sets validator field.
func (*StringContainsAny) SetNameIndex ¶
func (v *StringContainsAny) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringContainsAny) Validate ¶
func (v *StringContainsAny) Validate(e *validator.Errors)
Validate adds an error if the Field does not contain at least one substrings from ComparedField.
type StringContainsNoneOf ¶
type StringContainsNoneOf struct { Name string Field string ComparedName string ComparedField []string Message string }
StringContainsNoneOf is a validator object. Validate adds an error if the Field contains at least one substrings from ComparedField.
func (*StringContainsNoneOf) SetField ¶
func (v *StringContainsNoneOf) SetField(s string)
SetField sets validator field.
func (*StringContainsNoneOf) SetNameIndex ¶
func (v *StringContainsNoneOf) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringContainsNoneOf) Validate ¶
func (v *StringContainsNoneOf) Validate(e *validator.Errors)
Validate adds an error if the Field contains at least one substrings from ComparedField.
type StringExclusion ¶
StringExclusion is a validator object. Validate adds an error if the Field is one of the values from the Blacklist.
func (*StringExclusion) SetField ¶
func (v *StringExclusion) SetField(s string)
SetField sets validator field.
func (*StringExclusion) SetNameIndex ¶
func (v *StringExclusion) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringExclusion) Validate ¶
func (v *StringExclusion) Validate(e *validator.Errors)
Validate adds an error if the Field is one of the values from the Blacklist.
type StringHasAlpha ¶
StringHasAlpha is a validator object. Validate adds an error if the Field has no letters.
func (*StringHasAlpha) SetField ¶
func (v *StringHasAlpha) SetField(s string)
SetField sets validator field.
func (*StringHasAlpha) SetNameIndex ¶
func (v *StringHasAlpha) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasAlpha) Validate ¶
func (v *StringHasAlpha) Validate(e *validator.Errors)
Validate adds an error if the Field has no letters.
type StringHasLowerCase ¶
StringHasLowerCase is a validator object. Validate adds an error if the Field has not lowercased letters. Empty string is valid.
func (*StringHasLowerCase) SetField ¶
func (v *StringHasLowerCase) SetField(s string)
SetField sets validator field.
func (*StringHasLowerCase) SetNameIndex ¶
func (v *StringHasLowerCase) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasLowerCase) Validate ¶
func (v *StringHasLowerCase) Validate(e *validator.Errors)
Validate adds an error if the Field has not lowercased letters. Empty string is valid.
type StringHasNoFileInPathParents ¶
StringHasNoFileInPathParents is a validator object. Validate adds an error if the Field contains path to a file.
func (*StringHasNoFileInPathParents) SetField ¶
func (v *StringHasNoFileInPathParents) SetField(s string)
SetField sets validator field.
func (*StringHasNoFileInPathParents) SetNameIndex ¶
func (v *StringHasNoFileInPathParents) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasNoFileInPathParents) Validate ¶
func (v *StringHasNoFileInPathParents) Validate(e *validator.Errors)
Validate adds an error if the Field contains path to a file.
type StringHasNoPrefix ¶
type StringHasNoPrefix struct { Name string Field string ComparedName string ComparedField string Message string }
StringHasNoPrefix is a validator object. Validate adds an error if the Field is prefixed with ComparedField.
func (*StringHasNoPrefix) SetField ¶
func (v *StringHasNoPrefix) SetField(s string)
SetField sets validator field.
func (*StringHasNoPrefix) SetNameIndex ¶
func (v *StringHasNoPrefix) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasNoPrefix) Validate ¶
func (v *StringHasNoPrefix) Validate(e *validator.Errors)
Validate adds an error if the Field is prefixed with ComparedField.
type StringHasNoSuffix ¶
type StringHasNoSuffix struct { Name string Field string ComparedName string ComparedField string Message string }
StringHasNoSuffix is a validator object. Validate adds an error if the Field is suffixed with ComparedField.
func (*StringHasNoSuffix) SetField ¶
func (v *StringHasNoSuffix) SetField(s string)
SetField sets validator field.
func (*StringHasNoSuffix) SetNameIndex ¶
func (v *StringHasNoSuffix) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasNoSuffix) Validate ¶
func (v *StringHasNoSuffix) Validate(e *validator.Errors)
Validate adds an error if the Field is suffixed with ComparedField.
type StringHasNoWhitespace ¶
StringHasNoWhitespace is a validator object. Validate adds an error if the Field has whitespace.
func (*StringHasNoWhitespace) SetField ¶
func (v *StringHasNoWhitespace) SetField(s string)
SetField sets validator field.
func (*StringHasNoWhitespace) SetNameIndex ¶
func (v *StringHasNoWhitespace) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasNoWhitespace) Validate ¶
func (v *StringHasNoWhitespace) Validate(e *validator.Errors)
Validate adds an error if the Field has whitespace.
type StringHasNumber ¶
StringHasNumber is a validator object. Validate adds an error if the Field has no numbers.
func (*StringHasNumber) SetField ¶
func (v *StringHasNumber) SetField(s string)
SetField sets validator field.
func (*StringHasNumber) SetNameIndex ¶
func (v *StringHasNumber) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasNumber) Validate ¶
func (v *StringHasNumber) Validate(e *validator.Errors)
Validate adds an error if the Field has no numbers.
type StringHasPrefix ¶
type StringHasPrefix struct { Name string Field string ComparedName string ComparedField string Message string }
StringHasPrefix is a validator object. Validate adds an error if the Field is not prefixed with ComparedField.
func (*StringHasPrefix) SetField ¶
func (v *StringHasPrefix) SetField(s string)
SetField sets validator field.
func (*StringHasPrefix) SetNameIndex ¶
func (v *StringHasPrefix) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasPrefix) Validate ¶
func (v *StringHasPrefix) Validate(e *validator.Errors)
Validate adds an error if the Field is not prefixed with ComparedField.
type StringHasPrefixAny ¶
type StringHasPrefixAny struct { Name string Field string ComparedName string ComparedField []string Message string }
StringHasPrefixAny is a validator object. Validate adds an error if the Field is not prefixed by at least one string from ComparedField.
func (*StringHasPrefixAny) SetField ¶
func (v *StringHasPrefixAny) SetField(s string)
SetField sets validator field.
func (*StringHasPrefixAny) SetNameIndex ¶
func (v *StringHasPrefixAny) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasPrefixAny) Validate ¶
func (v *StringHasPrefixAny) Validate(e *validator.Errors)
Validate adds an error if the Field is not prefixed by at least one string from ComparedField.
type StringHasPrefixNoneOf ¶
type StringHasPrefixNoneOf struct { Name string Field string ComparedName string ComparedField []string Message string }
StringHasPrefixNoneOf is a validator object. Validate adds an error if the Field is prefixed by at least one string from ComparedField.
func (*StringHasPrefixNoneOf) SetField ¶
func (v *StringHasPrefixNoneOf) SetField(s string)
SetField sets validator field.
func (*StringHasPrefixNoneOf) SetNameIndex ¶
func (v *StringHasPrefixNoneOf) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasPrefixNoneOf) Validate ¶
func (v *StringHasPrefixNoneOf) Validate(e *validator.Errors)
Validate adds an error if the Field is prefixed by at least one string from ComparedField.
type StringHasSuffix ¶
type StringHasSuffix struct { Name string Field string ComparedName string ComparedField string Message string }
StringHasSuffix is a validator object. Validate adds an error if the Field is not suffixed with ComparedField.
func (*StringHasSuffix) SetField ¶
func (v *StringHasSuffix) SetField(s string)
SetField sets validator field.
func (*StringHasSuffix) SetNameIndex ¶
func (v *StringHasSuffix) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasSuffix) Validate ¶
func (v *StringHasSuffix) Validate(e *validator.Errors)
Validate adds an error if the Field is not suffixed with ComparedField.
type StringHasSuffixAny ¶
type StringHasSuffixAny struct { Name string Field string ComparedName string ComparedField []string Message string }
StringHasSuffixAny is a validator object. Validate adds an error if the Field is not Suffixed by at least one string from ComparedField.
func (*StringHasSuffixAny) SetField ¶
func (v *StringHasSuffixAny) SetField(s string)
SetField sets validator field.
func (*StringHasSuffixAny) SetNameIndex ¶
func (v *StringHasSuffixAny) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasSuffixAny) Validate ¶
func (v *StringHasSuffixAny) Validate(e *validator.Errors)
Validate adds an error if the Field is not Suffixed by at least one string from ComparedField.
type StringHasSuffixNoneOf ¶
type StringHasSuffixNoneOf struct { Name string Field string ComparedName string ComparedField []string Message string }
StringHasSuffixNoneOf is a validator object. Validate adds an error if the Field is Suffixed by at least one string from ComparedField.
func (*StringHasSuffixNoneOf) SetField ¶
func (v *StringHasSuffixNoneOf) SetField(s string)
SetField sets validator field.
func (*StringHasSuffixNoneOf) SetNameIndex ¶
func (v *StringHasSuffixNoneOf) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasSuffixNoneOf) Validate ¶
func (v *StringHasSuffixNoneOf) Validate(e *validator.Errors)
Validate adds an error if the Field is Suffixed by at least one string from ComparedField.
type StringHasUpperCase ¶
StringHasUpperCase is a validator object. Validate adds an error if the Field has not uppercased letters. Empty string is valid.
func (*StringHasUpperCase) SetField ¶
func (v *StringHasUpperCase) SetField(s string)
SetField sets validator field.
func (*StringHasUpperCase) SetNameIndex ¶
func (v *StringHasUpperCase) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringHasUpperCase) Validate ¶
func (v *StringHasUpperCase) Validate(e *validator.Errors)
Validate adds an error if the Field has not uppercased letters. Empty string is valid.
type StringInclusion ¶
StringInclusion is a validator object. Validate adds an error if the Field is NOT one of the values from the Whitelist.
func (*StringInclusion) SetField ¶
func (v *StringInclusion) SetField(s string)
SetField sets validator field.
func (*StringInclusion) SetNameIndex ¶
func (v *StringInclusion) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringInclusion) Validate ¶
func (v *StringInclusion) Validate(e *validator.Errors)
Validate adds an error if the Field is NOT one of the values from the Whitelist.
type StringIsASCII ¶
StringIsASCII is a validator object. Validate adds an error if the Field contains anything except for ASCII characters. Empty string is valid.
func (*StringIsASCII) SetField ¶
func (v *StringIsASCII) SetField(s string)
SetField sets validator field.
func (*StringIsASCII) SetNameIndex ¶
func (v *StringIsASCII) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsASCII) Validate ¶
func (v *StringIsASCII) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except for ASCII characters. Empty string is valid.
type StringIsAbsPath ¶
StringIsAbsPath is a validator object. Validate adds an error if Field is not an absolute path.
func (*StringIsAbsPath) SetField ¶
func (v *StringIsAbsPath) SetField(s string)
SetField sets validator field.
func (*StringIsAbsPath) SetNameIndex ¶
func (v *StringIsAbsPath) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsAbsPath) Validate ¶
func (v *StringIsAbsPath) Validate(e *validator.Errors)
Validate adds an error if Field is not an absolute path.
type StringIsAlpha ¶
StringIsAlpha is a validator object. Validate adds an error if the Field contains anything except for latin letters. Empty string is valid.
func (*StringIsAlpha) SetField ¶
func (v *StringIsAlpha) SetField(s string)
SetField sets validator field.
func (*StringIsAlpha) SetNameIndex ¶
func (v *StringIsAlpha) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsAlpha) Validate ¶
func (v *StringIsAlpha) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except for latin letters. Empty string is valid.
type StringIsAlphaNum ¶
StringIsAlphaNum is a validator object. Validate adds an error if the Field contains any symbols except for arabic numerals and latin letters. Empty string is valid.
func (*StringIsAlphaNum) SetField ¶
func (v *StringIsAlphaNum) SetField(s string)
SetField sets validator field.
func (*StringIsAlphaNum) SetNameIndex ¶
func (v *StringIsAlphaNum) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsAlphaNum) Validate ¶
func (v *StringIsAlphaNum) Validate(e *validator.Errors)
Validate adds an error if the Field contains any symbols except for arabic numerals and latin letters. Empty string is valid.
type StringIsBase64 ¶
StringIsBase64 is a validator object. Validate adds an error if the Field is not base64 encoded. Empty string is valid.
func (*StringIsBase64) SetField ¶
func (v *StringIsBase64) SetField(s string)
SetField sets validator field.
func (*StringIsBase64) SetNameIndex ¶
func (v *StringIsBase64) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsBase64) Validate ¶
func (v *StringIsBase64) Validate(e *validator.Errors)
Validate adds an error if the Field is not base64 encoded. Empty string is valid.
type StringIsCIDR ¶
StringIsCIDR is a validator object. Validate adds an error if the Field is not a valid CIDR notation address.
func (*StringIsCIDR) SetField ¶
func (v *StringIsCIDR) SetField(s string)
SetField sets validator field.
func (*StringIsCIDR) SetNameIndex ¶
func (v *StringIsCIDR) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsCIDR) Validate ¶
func (v *StringIsCIDR) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid CIDR notation address.
type StringIsCIDRv4 ¶
StringIsCIDRv4 is a validator object. Validate adds an error if the Field is not a valid CIDR notation of IPv4 address.
func (*StringIsCIDRv4) SetField ¶
func (v *StringIsCIDRv4) SetField(s string)
SetField sets validator field.
func (*StringIsCIDRv4) SetNameIndex ¶
func (v *StringIsCIDRv4) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsCIDRv4) Validate ¶
func (v *StringIsCIDRv4) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid CIDR notation of IPv4 address.
type StringIsCIDRv6 ¶
StringIsCIDRv6 is a validator object. Validate adds an error if the Field is not a CIDR notation of IPv6 address.
func (*StringIsCIDRv6) SetField ¶
func (v *StringIsCIDRv6) SetField(s string)
SetField sets validator field.
func (*StringIsCIDRv6) SetNameIndex ¶
func (v *StringIsCIDRv6) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsCIDRv6) Validate ¶
func (v *StringIsCIDRv6) Validate(e *validator.Errors)
Validate adds an error if the Field is not a CIDR notation of IPv6 address.
type StringIsDir ¶
StringIsDir is a validator object. Validate adds an error if the Field is not a path to directory.
func (*StringIsDir) SetField ¶
func (v *StringIsDir) SetField(s string)
SetField sets validator field.
func (*StringIsDir) SetNameIndex ¶
func (v *StringIsDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsDir) Validate ¶
func (v *StringIsDir) Validate(e *validator.Errors)
Validate adds an error if the Field is not a path to directory.
type StringIsDirWithModeSticky ¶
StringIsDirWithModeSticky is a validator object. Validate adds an error if the Field is not a dir or a dir without sticky mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsDirWithModeSticky) SetField ¶
func (v *StringIsDirWithModeSticky) SetField(s string)
SetField sets validator field.
func (*StringIsDirWithModeSticky) SetNameIndex ¶
func (v *StringIsDirWithModeSticky) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsDirWithModeSticky) Validate ¶
func (v *StringIsDirWithModeSticky) Validate(e *validator.Errors)
Validate adds an error if the Field is not a dir or a dir without sticky mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsDirWithoutModeSticky ¶
StringIsDirWithoutModeSticky is a validator object. Validate adds an error if the Field is not a dir or a dir with mode sticky. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsDirWithoutModeSticky) SetField ¶
func (v *StringIsDirWithoutModeSticky) SetField(s string)
SetField sets validator field.
func (*StringIsDirWithoutModeSticky) SetNameIndex ¶
func (v *StringIsDirWithoutModeSticky) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsDirWithoutModeSticky) Validate ¶
func (v *StringIsDirWithoutModeSticky) Validate(e *validator.Errors)
Validate adds an error if the Field is not a dir or a dir with mode sticky. If Field is a symlink, the symlink's target will be assessed.
type StringIsEmail ¶
StringIsEmail is a validator object. Validate adds an error if the Field does not match email regexp. See Email const.
func (*StringIsEmail) SetField ¶
func (v *StringIsEmail) SetField(s string)
SetField sets validator field.
func (*StringIsEmail) SetNameIndex ¶
func (v *StringIsEmail) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsEmail) Validate ¶
func (v *StringIsEmail) Validate(e *validator.Errors)
Validate adds an error if the Field does not match email regexp. See Email const.
type StringIsEmailLike ¶
StringIsEmailLike is a validator object. Validate adds an error if the Field does not correspond to "username@domain" structure. It also checks that domain has a domain zone (but does not check if the zone is valid). Also allows inner and outer whitespaces.
func (*StringIsEmailLike) SetField ¶
func (v *StringIsEmailLike) SetField(s string)
SetField sets validator field.
func (*StringIsEmailLike) SetNameIndex ¶
func (v *StringIsEmailLike) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsEmailLike) Validate ¶
func (v *StringIsEmailLike) Validate(e *validator.Errors)
Validate adds an error if the Field does not correspond to "username@domain" structure. It also checks that domain has a domain zone (but does not check if the zone is valid). Also allows inner and outer whitespaces.
type StringIsExistingGroup ¶
StringIsExistingGroup is a validator object. Validate adds an error if the Field is a user group that does not exist.
func (*StringIsExistingGroup) SetField ¶
func (v *StringIsExistingGroup) SetField(s string)
SetField sets validator field.
func (*StringIsExistingGroup) SetNameIndex ¶
func (v *StringIsExistingGroup) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsExistingGroup) Validate ¶
func (v *StringIsExistingGroup) Validate(e *validator.Errors)
Validate adds an error if the Field is a user group that does not exist.
type StringIsExistingUser ¶
StringIsExistingUser is a validator object. Validate adds an error if the Field is a user that does not exist.
func (*StringIsExistingUser) SetField ¶
func (v *StringIsExistingUser) SetField(s string)
SetField sets validator field.
func (*StringIsExistingUser) SetNameIndex ¶
func (v *StringIsExistingUser) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsExistingUser) Validate ¶
func (v *StringIsExistingUser) Validate(e *validator.Errors)
Validate adds an error if the Field is a user that does not exist.
type StringIsFile ¶
StringIsFile is a validator object. Validate adds an error if the Field is not a file.
func (*StringIsFile) SetField ¶
func (v *StringIsFile) SetField(s string)
SetField sets validator field.
func (*StringIsFile) SetNameIndex ¶
func (v *StringIsFile) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsFile) Validate ¶
func (v *StringIsFile) Validate(e *validator.Errors)
Validate adds an error if the Field is not a file.
type StringIsFileAndIsExecutable ¶
StringIsFileAndIsExecutable is a validator object. Validate adds an error if the Field is a file without execute bit set.
func (*StringIsFileAndIsExecutable) SetField ¶
func (v *StringIsFileAndIsExecutable) SetField(s string)
SetField sets validator field.
func (*StringIsFileAndIsExecutable) SetNameIndex ¶
func (v *StringIsFileAndIsExecutable) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsFileAndIsExecutable) Validate ¶
func (v *StringIsFileAndIsExecutable) Validate(e *validator.Errors)
Validate adds an error if the Field is a file without execute bit set.
type StringIsFileAndIsNotExecutable ¶
StringIsFileAndIsNotExecutable is a validator object. Validate adds an error if the Field is a file with execute bit set.
func (*StringIsFileAndIsNotExecutable) SetField ¶
func (v *StringIsFileAndIsNotExecutable) SetField(s string)
SetField sets validator field.
func (*StringIsFileAndIsNotExecutable) SetNameIndex ¶
func (v *StringIsFileAndIsNotExecutable) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsFileAndIsNotExecutable) Validate ¶
func (v *StringIsFileAndIsNotExecutable) Validate(e *validator.Errors)
Validate adds an error if the Field is a file with execute bit set.
type StringIsFloat ¶
StringIsFloat is a validator object. Validate add an error if the Field is not a float. Empty string is valid.
func (*StringIsFloat) SetField ¶
func (v *StringIsFloat) SetField(s string)
SetField sets validator field.
func (*StringIsFloat) SetNameIndex ¶
func (v *StringIsFloat) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsFloat) Validate ¶
func (v *StringIsFloat) Validate(e *validator.Errors)
Validate add an error if the Field is not a float. Empty string is valid.
type StringIsHTTPURL ¶
StringIsHTTPURL is a validator object. Validate adds an error if the Field is not a correctly formatted URL.
func (*StringIsHTTPURL) SetField ¶
func (v *StringIsHTTPURL) SetField(s string)
SetField sets validator field.
func (*StringIsHTTPURL) SetNameIndex ¶
func (v *StringIsHTTPURL) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsHTTPURL) Validate ¶
func (v *StringIsHTTPURL) Validate(e *validator.Errors)
Validate adds an error if the Field is not a correctly formatted URL.
type StringIsHash ¶
StringIsHash is a validator object. Validate adds an error if the Field is not formatted as a hash of provided type algorithm. Algorithm can be one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'].
func (*StringIsHash) SetField ¶
func (v *StringIsHash) SetField(s string)
SetField sets validator field.
func (*StringIsHash) SetNameIndex ¶
func (v *StringIsHash) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsHash) Validate ¶
func (v *StringIsHash) Validate(e *validator.Errors)
Validate adds an error if the Field is not formatted as a hash of provided type algorithm. Algorithm can be one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'].
type StringIsHexadecimal ¶
StringIsHexadecimal is a validator object. Validate adds an error if the Field is not in a hexadecimal format.
func (*StringIsHexadecimal) SetField ¶
func (v *StringIsHexadecimal) SetField(s string)
SetField sets validator field.
func (*StringIsHexadecimal) SetNameIndex ¶
func (v *StringIsHexadecimal) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsHexadecimal) Validate ¶
func (v *StringIsHexadecimal) Validate(e *validator.Errors)
Validate adds an error if the Field is not in a hexadecimal format.
type StringIsHexcolor ¶
StringIsHexcolor is a validator object. Validate adds an error if the Field is not formatted as a hexadecimal color. Leading '#' is required (e.g. "#1f1f1F", "#F00").
func (*StringIsHexcolor) SetField ¶
func (v *StringIsHexcolor) SetField(s string)
SetField sets validator field.
func (*StringIsHexcolor) SetNameIndex ¶
func (v *StringIsHexcolor) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsHexcolor) Validate ¶
func (v *StringIsHexcolor) Validate(e *validator.Errors)
Validate adds an error if the Field is not formatted as a hexadecimal color. Leading '#' is required (e.g. "#1f1f1F", "#F00").
type StringIsIP ¶
StringIsIP is a validator object. Validate adds an error if the Field is a valid IP address version 4 or 6.
func (*StringIsIP) SetField ¶
func (v *StringIsIP) SetField(s string)
SetField sets validator field.
func (*StringIsIP) SetNameIndex ¶
func (v *StringIsIP) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIP) Validate ¶
func (v *StringIsIP) Validate(e *validator.Errors)
Validate adds an error if the Field is a valid IP address version 4 or 6.
type StringIsIPGlobalUnicast ¶
StringIsIPGlobalUnicast is a validator object. Validate adds an error if the Field is not a valid Global Unicast IP address. Error is not added if ip is in IPv4 private address space or local IPv6 unicast address space.
func (*StringIsIPGlobalUnicast) SetField ¶
func (v *StringIsIPGlobalUnicast) SetField(s string)
SetField sets validator field.
func (*StringIsIPGlobalUnicast) SetNameIndex ¶
func (v *StringIsIPGlobalUnicast) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPGlobalUnicast) Validate ¶
func (v *StringIsIPGlobalUnicast) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid Global Unicast IP address. Error is not added if ip is in IPv4 private address space or local IPv6 unicast address space.
type StringIsIPHasPTR ¶
StringIsIPHasPTR is a validator object. Validate adds an error if the Field is an IP address that does not have PTR record.
func (*StringIsIPHasPTR) SetField ¶
func (v *StringIsIPHasPTR) SetField(s string)
SetField sets validator field.
func (*StringIsIPHasPTR) SetNameIndex ¶
func (v *StringIsIPHasPTR) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPHasPTR) Validate ¶
func (v *StringIsIPHasPTR) Validate(e *validator.Errors)
Validate adds an error if the Field is an IP address that does not have PTR record.
type StringIsIPIfaceLocalMulticast ¶
StringIsIPIfaceLocalMulticast is a validator object. Validate adds an error if the Field is not an interface-local multicast address.
func (*StringIsIPIfaceLocalMulticast) SetField ¶
func (v *StringIsIPIfaceLocalMulticast) SetField(s string)
SetField sets validator field.
func (*StringIsIPIfaceLocalMulticast) SetNameIndex ¶
func (v *StringIsIPIfaceLocalMulticast) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPIfaceLocalMulticast) Validate ¶
func (v *StringIsIPIfaceLocalMulticast) Validate(e *validator.Errors)
Validate adds an error if the Field is not an interface-local multicast address.
type StringIsIPLinkLocalMulticast ¶
StringIsIPLinkLocalMulticast is a validator object. Validate adds an error if the Field is not a link-local multicast address.
func (*StringIsIPLinkLocalMulticast) SetField ¶
func (v *StringIsIPLinkLocalMulticast) SetField(s string)
SetField sets validator field.
func (*StringIsIPLinkLocalMulticast) SetNameIndex ¶
func (v *StringIsIPLinkLocalMulticast) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPLinkLocalMulticast) Validate ¶
func (v *StringIsIPLinkLocalMulticast) Validate(e *validator.Errors)
Validate adds an error if the Field is not a link-local multicast address.
type StringIsIPLinkLocalUnicast ¶
StringIsIPLinkLocalUnicast is a validator object. Validate adds an error if the Field is not a link-local unicast address.
func (*StringIsIPLinkLocalUnicast) SetField ¶
func (v *StringIsIPLinkLocalUnicast) SetField(s string)
SetField sets validator field.
func (*StringIsIPLinkLocalUnicast) SetNameIndex ¶
func (v *StringIsIPLinkLocalUnicast) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPLinkLocalUnicast) Validate ¶
func (v *StringIsIPLinkLocalUnicast) Validate(e *validator.Errors)
Validate adds an error if the Field is not a link-local unicast address.
type StringIsIPLoopback ¶
StringIsIPLoopback is a validator object. Validate adds an error if the Field is not a loopback address.
func (*StringIsIPLoopback) SetField ¶
func (v *StringIsIPLoopback) SetField(s string)
SetField sets validator field.
func (*StringIsIPLoopback) SetNameIndex ¶
func (v *StringIsIPLoopback) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPLoopback) Validate ¶
func (v *StringIsIPLoopback) Validate(e *validator.Errors)
Validate adds an error if the Field is not a loopback address.
type StringIsIPMulticast ¶
StringIsIPMulticast is a validator object. Validate adds an error if the Field is not a multicast address.
func (*StringIsIPMulticast) SetField ¶
func (v *StringIsIPMulticast) SetField(s string)
SetField sets validator field.
func (*StringIsIPMulticast) SetNameIndex ¶
func (v *StringIsIPMulticast) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPMulticast) Validate ¶
func (v *StringIsIPMulticast) Validate(e *validator.Errors)
Validate adds an error if the Field is not a multicast address.
type StringIsIPUnspec ¶
StringIsIPUnspec is a validator object. Validate adds an error if the Field is not an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address.
func (*StringIsIPUnspec) SetField ¶
func (v *StringIsIPUnspec) SetField(s string)
SetField sets validator field.
func (*StringIsIPUnspec) SetNameIndex ¶
func (v *StringIsIPUnspec) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPUnspec) Validate ¶
func (v *StringIsIPUnspec) Validate(e *validator.Errors)
Validate adds an error if the Field is not an unspecified address, either the IPv4 address "0.0.0.0" or the IPv6 address.
type StringIsIPv4 ¶
StringIsIPv4 is a validator object. Validate adds an error if the Field is not a valid IPv4 address.
func (*StringIsIPv4) SetField ¶
func (v *StringIsIPv4) SetField(s string)
SetField sets validator field.
func (*StringIsIPv4) SetNameIndex ¶
func (v *StringIsIPv4) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPv4) Validate ¶
func (v *StringIsIPv4) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid IPv4 address.
type StringIsIPv6 ¶
StringIsIPv6 is a validator object. Validate adds an error if the Field is not a valid IPv6 address.
func (*StringIsIPv6) SetField ¶
func (v *StringIsIPv6) SetField(s string)
SetField sets validator field.
func (*StringIsIPv6) SetNameIndex ¶
func (v *StringIsIPv6) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsIPv6) Validate ¶
func (v *StringIsIPv6) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid IPv6 address.
type StringIsInt ¶
StringIsInt is a validator object. Validate adds an error if the Field is not an integer. Leading sign is allowed. Empty string is valid.
func (*StringIsInt) SetField ¶
func (v *StringIsInt) SetField(s string)
SetField sets validator field.
func (*StringIsInt) SetNameIndex ¶
func (v *StringIsInt) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsInt) Validate ¶
func (v *StringIsInt) Validate(e *validator.Errors)
Validate adds an error if the Field is not an integer. Leading sign is allowed. Empty string is valid.
type StringIsJSON ¶
StringIsJSON is a validator object. Validate adds an error if the Field is not a valid JSON.
func (*StringIsJSON) SetField ¶
func (v *StringIsJSON) SetField(s string)
SetField sets validator field.
func (*StringIsJSON) SetNameIndex ¶
func (v *StringIsJSON) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsJSON) Validate ¶
func (v *StringIsJSON) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid JSON.
type StringIsLowerCase ¶
StringIsLowerCase is a validator object. Validate adds an error if the Field is not lowercased. Empty string is valid.
func (*StringIsLowerCase) SetField ¶
func (v *StringIsLowerCase) SetField(s string)
SetField sets validator field.
func (*StringIsLowerCase) SetNameIndex ¶
func (v *StringIsLowerCase) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsLowerCase) Validate ¶
func (v *StringIsLowerCase) Validate(e *validator.Errors)
Validate adds an error if the Field is not lowercased. Empty string is valid.
type StringIsMAC ¶
StringIsMAC is a validator object. Validate adds an error if the Field is not a MAC address.
func (*StringIsMAC) SetField ¶
func (v *StringIsMAC) SetField(s string)
SetField sets validator field.
func (*StringIsMAC) SetNameIndex ¶
func (v *StringIsMAC) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsMAC) Validate ¶
func (v *StringIsMAC) Validate(e *validator.Errors)
Validate adds an error if the Field is not a MAC address.
type StringIsNotDir ¶
StringIsNotDir is a validator object. Validate adds an error if the Field is a path to directory.
func (*StringIsNotDir) SetField ¶
func (v *StringIsNotDir) SetField(s string)
SetField sets validator field.
func (*StringIsNotDir) SetNameIndex ¶
func (v *StringIsNotDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotDir) Validate ¶
func (v *StringIsNotDir) Validate(e *validator.Errors)
Validate adds an error if the Field is a path to directory.
type StringIsNotExistingGroup ¶
StringIsNotExistingGroup is a validator object. Validate adds an error if the Field is a user group that exists.
func (*StringIsNotExistingGroup) SetField ¶
func (v *StringIsNotExistingGroup) SetField(s string)
SetField sets validator field.
func (*StringIsNotExistingGroup) SetNameIndex ¶
func (v *StringIsNotExistingGroup) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotExistingGroup) Validate ¶
func (v *StringIsNotExistingGroup) Validate(e *validator.Errors)
Validate adds an error if the Field is a user group that exists.
type StringIsNotExistingUser ¶
StringIsNotExistingUser is a validator object. Validate adds an error if the Field is an existing user.
func (*StringIsNotExistingUser) SetField ¶
func (v *StringIsNotExistingUser) SetField(s string)
SetField sets validator field.
func (*StringIsNotExistingUser) SetNameIndex ¶
func (v *StringIsNotExistingUser) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotExistingUser) Validate ¶
func (v *StringIsNotExistingUser) Validate(e *validator.Errors)
Validate adds an error if the Field is an existing user.
type StringIsNotFile ¶
StringIsNotFile is a validator object. Validate adds an error if the Field is a file.
func (*StringIsNotFile) SetField ¶
func (v *StringIsNotFile) SetField(s string)
SetField sets validator field.
func (*StringIsNotFile) SetNameIndex ¶
func (v *StringIsNotFile) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotFile) Validate ¶
func (v *StringIsNotFile) Validate(e *validator.Errors)
Validate adds an error if the Field is a file.
type StringIsNotNumeric ¶
StringIsNotNumeric is a validator object. Validate adds an error if the Field is numeric.
func (*StringIsNotNumeric) SetField ¶
func (v *StringIsNotNumeric) SetField(s string)
SetField sets validator field.
func (*StringIsNotNumeric) SetNameIndex ¶
func (v *StringIsNotNumeric) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotNumeric) Validate ¶
func (v *StringIsNotNumeric) Validate(e *validator.Errors)
Validate adds an error if the Field is numeric.
type StringIsNotPath ¶
StringIsNotPath is a validator object. Validate adds an error if the Field is an existing path.
func (*StringIsNotPath) SetField ¶
func (v *StringIsNotPath) SetField(s string)
SetField sets validator field.
func (*StringIsNotPath) SetNameIndex ¶
func (v *StringIsNotPath) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotPath) Validate ¶
func (v *StringIsNotPath) Validate(e *validator.Errors)
Validate adds an error if the Field is an existing path.
type StringIsNotRegularUser ¶
StringIsNotRegularUser is a validator object.
func (*StringIsNotRegularUser) SetField ¶
func (v *StringIsNotRegularUser) SetField(s string)
SetField sets validator field.
func (*StringIsNotRegularUser) SetNameIndex ¶
func (v *StringIsNotRegularUser) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotRegularUser) Validate ¶
func (v *StringIsNotRegularUser) Validate(e *validator.Errors)
Validate adds an error if the Field is a regular user.
type StringIsNotResolvableHostname ¶
StringIsNotResolvableHostname is a validator object. Validate adds an error if the Field is a resolvable hostname.
func (*StringIsNotResolvableHostname) SetField ¶
func (v *StringIsNotResolvableHostname) SetField(s string)
SetField sets validator field.
func (*StringIsNotResolvableHostname) SetNameIndex ¶
func (v *StringIsNotResolvableHostname) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotResolvableHostname) Validate ¶
func (v *StringIsNotResolvableHostname) Validate(e *validator.Errors)
Validate adds an error if the Field is a resolvable hostname.
type StringIsNotResolvableHostnameNorIP ¶
StringIsNotResolvableHostnameNorIP is a validator object. Validate adds an error if the Field is a resolvable hostname or an IP address.
func (*StringIsNotResolvableHostnameNorIP) SetField ¶
func (v *StringIsNotResolvableHostnameNorIP) SetField(s string)
SetField sets validator field.
func (*StringIsNotResolvableHostnameNorIP) SetNameIndex ¶
func (v *StringIsNotResolvableHostnameNorIP) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotResolvableHostnameNorIP) Validate ¶
func (v *StringIsNotResolvableHostnameNorIP) Validate(e *validator.Errors)
Validate adds an error if the Field is a resolvable hostname or an IP address.
type StringIsNotResolvableHostnameNorIPv4 ¶
StringIsNotResolvableHostnameNorIPv4 is a validator object. Validate adds an error if the Field is a resolvable hostname or an IPv4 address.
func (*StringIsNotResolvableHostnameNorIPv4) SetField ¶
func (v *StringIsNotResolvableHostnameNorIPv4) SetField(s string)
SetField sets validator field.
func (*StringIsNotResolvableHostnameNorIPv4) SetNameIndex ¶
func (v *StringIsNotResolvableHostnameNorIPv4) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotResolvableHostnameNorIPv4) Validate ¶
func (v *StringIsNotResolvableHostnameNorIPv4) Validate(e *validator.Errors)
Validate adds an error if the Field is a resolvable hostname or an IPv4 address.
type StringIsNotResolvableHostnameNorIPv6 ¶
StringIsNotResolvableHostnameNorIPv6 is a validator object. Validate adds an error if the Field is a resolvable hostname or an IPv6 address.
func (*StringIsNotResolvableHostnameNorIPv6) SetField ¶
func (v *StringIsNotResolvableHostnameNorIPv6) SetField(s string)
SetField sets validator field.
func (*StringIsNotResolvableHostnameNorIPv6) SetNameIndex ¶
func (v *StringIsNotResolvableHostnameNorIPv6) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotResolvableHostnameNorIPv6) Validate ¶
func (v *StringIsNotResolvableHostnameNorIPv6) Validate(e *validator.Errors)
Validate adds an error if the Field is a resolvable hostname or an IPv6 address.
type StringIsNotSymlink ¶
StringIsNotSymlink is a validator object. Validate adds an error if the Field is a symlink.
func (*StringIsNotSymlink) SetField ¶
func (v *StringIsNotSymlink) SetField(s string)
SetField sets validator field.
func (*StringIsNotSymlink) SetNameIndex ¶
func (v *StringIsNotSymlink) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotSymlink) Validate ¶
func (v *StringIsNotSymlink) Validate(e *validator.Errors)
Validate adds an error if the Field is a symlink.
type StringIsNotUserGroup ¶
StringIsNotUserGroup is a validator object. Validate adds an error if the Field is a user group.
func (*StringIsNotUserGroup) SetField ¶
func (v *StringIsNotUserGroup) SetField(s string)
SetField sets validator field.
func (*StringIsNotUserGroup) SetNameIndex ¶
func (v *StringIsNotUserGroup) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNotUserGroup) Validate ¶
func (v *StringIsNotUserGroup) Validate(e *validator.Errors)
Validate adds an error if the Field is a user group.
type StringIsNull ¶
StringIsNull is a validator object. Validate adds an error if the Field is an empty string. Emptry string is defined as such with length 0. If you want to allow whitespaces - see StringIsPresent validator.
func (*StringIsNull) SetField ¶
func (v *StringIsNull) SetField(s string)
SetField sets validator field.
func (*StringIsNull) SetNameIndex ¶
func (v *StringIsNull) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNull) Validate ¶
func (v *StringIsNull) Validate(e *validator.Errors)
Validate adds an error if the Field is an empty string. Emptry string is defined as such with length 0. If you want to allow whitespaces - see StringIsPresent validator.
type StringIsNumeric ¶
StringIsNumeric is a validator object. Validate adds an error if the Field is not numeric. Empty string is valid.
func (*StringIsNumeric) SetField ¶
func (v *StringIsNumeric) SetField(s string)
SetField sets validator field.
func (*StringIsNumeric) SetNameIndex ¶
func (v *StringIsNumeric) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsNumeric) Validate ¶
func (v *StringIsNumeric) Validate(e *validator.Errors)
Validate adds an error if the Field is not numeric. Empty string is valid.
type StringIsPath ¶
StringIsPath is a validator object. Validate adds an error if the Field is a path that does not exist.
func (*StringIsPath) SetField ¶
func (v *StringIsPath) SetField(s string)
SetField sets validator field.
func (*StringIsPath) SetNameIndex ¶
func (v *StringIsPath) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPath) Validate ¶
func (v *StringIsPath) Validate(e *validator.Errors)
Validate adds an error if the Field is a path that does not exist.
type StringIsPathAndCharDevice ¶
StringIsPathAndCharDevice is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without CharDevice mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndCharDevice) SetField ¶
func (v *StringIsPathAndCharDevice) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndCharDevice) SetNameIndex ¶
func (v *StringIsPathAndCharDevice) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndCharDevice) Validate ¶
func (v *StringIsPathAndCharDevice) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without CharDevice mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndDevice ¶
StringIsPathAndDevice is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without Device mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndDevice) SetField ¶
func (v *StringIsPathAndDevice) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndDevice) SetNameIndex ¶
func (v *StringIsPathAndDevice) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndDevice) Validate ¶
func (v *StringIsPathAndDevice) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without Device mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndIrregularFile ¶
StringIsPathAndIrregularFile is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without Irregular mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndIrregularFile) SetField ¶
func (v *StringIsPathAndIrregularFile) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndIrregularFile) SetNameIndex ¶
func (v *StringIsPathAndIrregularFile) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndIrregularFile) Validate ¶
func (v *StringIsPathAndIrregularFile) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without Irregular mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndIsWritable ¶
StringIsPathAndIsWritable is a validator object. Validate adds an error if the Field is a path and is not writable.
func (*StringIsPathAndIsWritable) SetField ¶
func (v *StringIsPathAndIsWritable) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndIsWritable) SetNameIndex ¶
func (v *StringIsPathAndIsWritable) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndIsWritable) Validate ¶
func (v *StringIsPathAndIsWritable) Validate(e *validator.Errors)
Validate adds an error if the Field is a path and is not writable.
type StringIsPathAndNamedPipe ¶
StringIsPathAndNamedPipe is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without NamedPipe mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndNamedPipe) SetField ¶
func (v *StringIsPathAndNamedPipe) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndNamedPipe) SetNameIndex ¶
func (v *StringIsPathAndNamedPipe) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndNamedPipe) Validate ¶
func (v *StringIsPathAndNamedPipe) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without NamedPipe mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndNotCharDevice ¶
StringIsPathAndNotCharDevice is a validator object. Validate adds an error if the Field is not an existing path or is an existing path with CharDevice mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndNotCharDevice) SetField ¶
func (v *StringIsPathAndNotCharDevice) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndNotCharDevice) SetNameIndex ¶
func (v *StringIsPathAndNotCharDevice) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndNotCharDevice) Validate ¶
func (v *StringIsPathAndNotCharDevice) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with CharDevice mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndNotDevice ¶
StringIsPathAndNotDevice is a validator object. Validate adds an error if the Field is not an existing path or is an existing path with Device mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndNotDevice) SetField ¶
func (v *StringIsPathAndNotDevice) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndNotDevice) SetNameIndex ¶
func (v *StringIsPathAndNotDevice) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndNotDevice) Validate ¶
func (v *StringIsPathAndNotDevice) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with Device mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndNotNamedPipe ¶
StringIsPathAndNotNamedPipe is a validator object. Validate adds an error if the Field is not an existing path or is an existing path with NamedPipe mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndNotNamedPipe) SetField ¶
func (v *StringIsPathAndNotNamedPipe) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndNotNamedPipe) SetNameIndex ¶
func (v *StringIsPathAndNotNamedPipe) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndNotNamedPipe) Validate ¶
func (v *StringIsPathAndNotNamedPipe) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with NamedPipe mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndNotSocket ¶
StringIsPathAndNotSocket is a validator object. Validate adds an error if the Field is not an existing path or is an existing path with Socket mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndNotSocket) SetField ¶
func (v *StringIsPathAndNotSocket) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndNotSocket) SetNameIndex ¶
func (v *StringIsPathAndNotSocket) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndNotSocket) Validate ¶
func (v *StringIsPathAndNotSocket) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with Socket mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndRegularFile ¶
StringIsPathAndRegularFile is a validator object. Validate adds an error if the Field is not an existing path or is an existing non-regular file. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndRegularFile) SetField ¶
func (v *StringIsPathAndRegularFile) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndRegularFile) SetNameIndex ¶
func (v *StringIsPathAndRegularFile) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndRegularFile) Validate ¶
func (v *StringIsPathAndRegularFile) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing non-regular file. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathAndSocket ¶
StringIsPathAndSocket is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without Socket mode. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathAndSocket) SetField ¶
func (v *StringIsPathAndSocket) SetField(s string)
SetField sets validator field.
func (*StringIsPathAndSocket) SetNameIndex ¶
func (v *StringIsPathAndSocket) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathAndSocket) Validate ¶
func (v *StringIsPathAndSocket) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without Socket mode. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathWithSetGID ¶
StringIsPathWithSetGID is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without SetGID flag. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathWithSetGID) SetField ¶
func (v *StringIsPathWithSetGID) SetField(s string)
SetField sets validator field.
func (*StringIsPathWithSetGID) SetNameIndex ¶
func (v *StringIsPathWithSetGID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathWithSetGID) Validate ¶
func (v *StringIsPathWithSetGID) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without SetGID flag. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathWithSetUID ¶
StringIsPathWithSetUID is a validator object. Validate adds an error if the Field is not an existing path or is an existing path without SetUID flag. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathWithSetUID) SetField ¶
func (v *StringIsPathWithSetUID) SetField(s string)
SetField sets validator field.
func (*StringIsPathWithSetUID) SetNameIndex ¶
func (v *StringIsPathWithSetUID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathWithSetUID) Validate ¶
func (v *StringIsPathWithSetUID) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path without SetUID flag. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathWithoutSetGID ¶
StringIsPathWithoutSetGID is a validator object. Validate adds an error if the Field is not an existing path or is an existing path with SetGID flag. If Field is a symlink, the symlink's target will be assessed.
func (*StringIsPathWithoutSetGID) SetField ¶
func (v *StringIsPathWithoutSetGID) SetField(s string)
SetField sets validator field.
func (*StringIsPathWithoutSetGID) SetNameIndex ¶
func (v *StringIsPathWithoutSetGID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathWithoutSetGID) Validate ¶
func (v *StringIsPathWithoutSetGID) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with SetGID flag. If Field is a symlink, the symlink's target will be assessed.
type StringIsPathWithoutSetUID ¶
StringIsPathWithoutSetUID is a validator object.
func (*StringIsPathWithoutSetUID) SetField ¶
func (v *StringIsPathWithoutSetUID) SetField(s string)
SetField sets validator field.
func (*StringIsPathWithoutSetUID) SetNameIndex ¶
func (v *StringIsPathWithoutSetUID) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPathWithoutSetUID) Validate ¶
func (v *StringIsPathWithoutSetUID) Validate(e *validator.Errors)
Validate adds an error if the Field is not an existing path or is an existing path with SetGID flag. If Field is a symlink, the symlink's target will be assessed.
type StringIsPort ¶
StringIsPort is a validator object. Validate adds an error if the Field does not represent a valid port.
func (*StringIsPort) SetField ¶
func (v *StringIsPort) SetField(s string)
SetField sets validator field.
func (*StringIsPort) SetNameIndex ¶
func (v *StringIsPort) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPort) Validate ¶
func (v *StringIsPort) Validate(e *validator.Errors)
Validate adds an error if the Field does not represent a valid port.
type StringIsPresent ¶
StringIsPresent is a validator object. Validate adds an error if the Field is empty or has only whitespaces. If you don't want whitespaces - see StringIsNull validator.
func (*StringIsPresent) SetField ¶
func (v *StringIsPresent) SetField(s string)
SetField sets validator field.
func (*StringIsPresent) SetNameIndex ¶
func (v *StringIsPresent) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPresent) Validate ¶
func (v *StringIsPresent) Validate(e *validator.Errors)
Validate adds an error if the Field is empty or has only whitespaces. If you don't want whitespaces - see StringIsNull validator.
type StringIsPrintableASCII ¶
StringIsPrintableASCII is a validator object. Validate adds an error if the Field contains anything except for printable ASCII characters. Empty string is valid.
func (*StringIsPrintableASCII) SetField ¶
func (v *StringIsPrintableASCII) SetField(s string)
SetField sets validator field.
func (*StringIsPrintableASCII) SetNameIndex ¶
func (v *StringIsPrintableASCII) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsPrintableASCII) Validate ¶
func (v *StringIsPrintableASCII) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except for printable ASCII characters. Empty string is valid.
type StringIsRGBcolor ¶
StringIsRGBcolor is a validator object. Validate adds an error if the Field is not formatted as an RGB color. Expected format is "rgb(RRR, GGG, BBB)".
func (*StringIsRGBcolor) SetField ¶
func (v *StringIsRGBcolor) SetField(s string)
SetField sets validator field.
func (*StringIsRGBcolor) SetNameIndex ¶
func (v *StringIsRGBcolor) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsRGBcolor) Validate ¶
func (v *StringIsRGBcolor) Validate(e *validator.Errors)
Validate adds an error if the Field is not formatted as an RGB color. Expected format is "rgb(RRR, GGG, BBB)".
type StringIsRegularUserOrWhitelisted ¶
type StringIsRegularUserOrWhitelisted struct { Name string Field string Whitelist []string Message string }
StringIsRegularUserOrWhitelisted is a validator object. Validate adds an error if the Field is not a regular user or whitelisted.
func (*StringIsRegularUserOrWhitelisted) SetField ¶
func (v *StringIsRegularUserOrWhitelisted) SetField(s string)
SetField sets validator field.
func (*StringIsRegularUserOrWhitelisted) SetNameIndex ¶
func (v *StringIsRegularUserOrWhitelisted) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsRegularUserOrWhitelisted) Validate ¶
func (v *StringIsRegularUserOrWhitelisted) Validate(e *validator.Errors)
Validate adds an error if the Field is not a regular user or whitelisted.
type StringIsResolvableHostname ¶
StringIsResolvableHostname is a validator object. Validate adds an error if the Field is not a resolvable hostname.
func (*StringIsResolvableHostname) SetField ¶
func (v *StringIsResolvableHostname) SetField(s string)
SetField sets validator field.
func (*StringIsResolvableHostname) SetNameIndex ¶
func (v *StringIsResolvableHostname) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsResolvableHostname) Validate ¶
func (v *StringIsResolvableHostname) Validate(e *validator.Errors)
Validate adds an error if the Field is not a resolvable hostname.
type StringIsResolvableHostnameOrIP ¶
StringIsResolvableHostnameOrIP is a validator object. Validate adds an error if the Field is not a resolvable hostname and not an IP address.
func (*StringIsResolvableHostnameOrIP) SetField ¶
func (v *StringIsResolvableHostnameOrIP) SetField(s string)
SetField sets validator field.
func (*StringIsResolvableHostnameOrIP) SetNameIndex ¶
func (v *StringIsResolvableHostnameOrIP) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsResolvableHostnameOrIP) Validate ¶
func (v *StringIsResolvableHostnameOrIP) Validate(e *validator.Errors)
Validate adds an error if the Field is not a resolvable hostname and not an IP address.
type StringIsResolvableHostnameOrIPv4 ¶
StringIsResolvableHostnameOrIPv4 is a validator object. Validate adds an error if the Field is not a resolvable hostname and not an IPv4 address.
func (*StringIsResolvableHostnameOrIPv4) SetField ¶
func (v *StringIsResolvableHostnameOrIPv4) SetField(s string)
SetField sets validator field.
func (*StringIsResolvableHostnameOrIPv4) SetNameIndex ¶
func (v *StringIsResolvableHostnameOrIPv4) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsResolvableHostnameOrIPv4) Validate ¶
func (v *StringIsResolvableHostnameOrIPv4) Validate(e *validator.Errors)
Validate adds an error if the Field is not a resolvable hostname and not an IPv4 address.
type StringIsResolvableHostnameOrIPv6 ¶
StringIsResolvableHostnameOrIPv6 is a validator object. Validate adds an error if the Field is not a resolvable hostname and not an IPv6 address.
func (*StringIsResolvableHostnameOrIPv6) SetField ¶
func (v *StringIsResolvableHostnameOrIPv6) SetField(s string)
SetField sets validator field.
func (*StringIsResolvableHostnameOrIPv6) SetNameIndex ¶
func (v *StringIsResolvableHostnameOrIPv6) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsResolvableHostnameOrIPv6) Validate ¶
func (v *StringIsResolvableHostnameOrIPv6) Validate(e *validator.Errors)
Validate adds an error if the Field is not a resolvable hostname and not an IPv6 address.
type StringIsSymlink ¶
StringIsSymlink is a validator object. Validate adds an error if the Field is not a symlink.
func (*StringIsSymlink) SetField ¶
func (v *StringIsSymlink) SetField(s string)
SetField sets validator field.
func (*StringIsSymlink) SetNameIndex ¶
func (v *StringIsSymlink) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsSymlink) Validate ¶
func (v *StringIsSymlink) Validate(e *validator.Errors)
Validate adds an error if the Field is not a symlink.
type StringIsSymlinkAndTargetIsDir ¶
StringIsSymlinkAndTargetIsDir is a validator object. Validate adds an error if the Field is a symlink and it's target is not a directory.
func (*StringIsSymlinkAndTargetIsDir) SetField ¶
func (v *StringIsSymlinkAndTargetIsDir) SetField(s string)
SetField sets validator field.
func (*StringIsSymlinkAndTargetIsDir) SetNameIndex ¶
func (v *StringIsSymlinkAndTargetIsDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsSymlinkAndTargetIsDir) Validate ¶
func (v *StringIsSymlinkAndTargetIsDir) Validate(e *validator.Errors)
Validate adds an error if the Field is a symlink and it's target is not a directory.
type StringIsSymlinkAndTargetIsNotDir ¶
StringIsSymlinkAndTargetIsNotDir is a validator object. Validate adds an error if the Field is a symlink and it's target is a directory.
func (*StringIsSymlinkAndTargetIsNotDir) SetField ¶
func (v *StringIsSymlinkAndTargetIsNotDir) SetField(s string)
SetField sets validator field.
func (*StringIsSymlinkAndTargetIsNotDir) SetNameIndex ¶
func (v *StringIsSymlinkAndTargetIsNotDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsSymlinkAndTargetIsNotDir) Validate ¶
func (v *StringIsSymlinkAndTargetIsNotDir) Validate(e *validator.Errors)
Validate adds an error if the Field is a symlink and it's target is a directory.
type StringIsSymlinkAndTargetIsNotPath ¶
StringIsSymlinkAndTargetIsNotPath is a validator object. Validate adds an error if the Field is a symlink and it's target is an existing path.
func (*StringIsSymlinkAndTargetIsNotPath) SetField ¶
func (v *StringIsSymlinkAndTargetIsNotPath) SetField(s string)
SetField sets validator field.
func (*StringIsSymlinkAndTargetIsNotPath) SetNameIndex ¶
func (v *StringIsSymlinkAndTargetIsNotPath) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsSymlinkAndTargetIsNotPath) Validate ¶
func (v *StringIsSymlinkAndTargetIsNotPath) Validate(e *validator.Errors)
Validate adds an error if the Field is a symlink and it's target is an existing path.
type StringIsSymlinkAndTargetIsPath ¶
StringIsSymlinkAndTargetIsPath is a validator object. Validate adds an error if the Field is a symlink and it's target is not an existing path.
func (*StringIsSymlinkAndTargetIsPath) SetField ¶
func (v *StringIsSymlinkAndTargetIsPath) SetField(s string)
SetField sets validator field.
func (*StringIsSymlinkAndTargetIsPath) SetNameIndex ¶
func (v *StringIsSymlinkAndTargetIsPath) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsSymlinkAndTargetIsPath) Validate ¶
func (v *StringIsSymlinkAndTargetIsPath) Validate(e *validator.Errors)
Validate adds an error if the Field is a symlink and it's target is not an existing path.
type StringIsUTFLetterNum ¶
StringIsUTFLetterNum is a validator object. Validate adds an error if the Field contains anything except unicode letters/numbers (category L/N). Empty string is valid.
func (*StringIsUTFLetterNum) SetField ¶
func (v *StringIsUTFLetterNum) SetField(s string)
SetField sets validator field.
func (*StringIsUTFLetterNum) SetNameIndex ¶
func (v *StringIsUTFLetterNum) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUTFLetterNum) Validate ¶
func (v *StringIsUTFLetterNum) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except unicode letters/numbers (category L/N). Empty string is valid.
type StringIsUTFLetters ¶
StringIsUTFLetters is a validator object. Validate adds an error if the Field contains anything except unicode letters (category L) Similar to StringIsAlpha but for all languages. Empty string is valid.
func (*StringIsUTFLetters) SetField ¶
func (v *StringIsUTFLetters) SetField(s string)
SetField sets validator field.
func (*StringIsUTFLetters) SetNameIndex ¶
func (v *StringIsUTFLetters) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUTFLetters) Validate ¶
func (v *StringIsUTFLetters) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except unicode letters (category L) Similar to StringIsAlpha but for all languages. Empty string is valid.
type StringIsUTFNumeric ¶
StringIsUTFNumeric is a validator object. Validate adds an error if the Field contains anything except unicode numbers (category N). Leading sign is allowed. Empty string is valid.
func (*StringIsUTFNumeric) SetField ¶
func (v *StringIsUTFNumeric) SetField(s string)
SetField sets validator field.
func (*StringIsUTFNumeric) SetNameIndex ¶
func (v *StringIsUTFNumeric) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUTFNumeric) Validate ¶
func (v *StringIsUTFNumeric) Validate(e *validator.Errors)
Validate adds an error if the Field contains anything except unicode numbers (category N). Leading sign is allowed. Empty string is valid.
type StringIsUnixFilePermission ¶
StringIsUnixFilePermission is a validator object. Validate adds an error if the Field is not a unix file permission.
func (*StringIsUnixFilePermission) SetField ¶
func (v *StringIsUnixFilePermission) SetField(s string)
SetField sets validator field.
func (*StringIsUnixFilePermission) SetNameIndex ¶
func (v *StringIsUnixFilePermission) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUnixFilePermission) Validate ¶
func (v *StringIsUnixFilePermission) Validate(e *validator.Errors)
Validate adds an error if the Field is not a unix file permission.
type StringIsUpperCase ¶
StringIsUpperCase is a validator object. Validate adds an error if the Field is not uppercased. Empty string is valid.
func (*StringIsUpperCase) SetField ¶
func (v *StringIsUpperCase) SetField(s string)
SetField sets validator field.
func (*StringIsUpperCase) SetNameIndex ¶
func (v *StringIsUpperCase) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUpperCase) Validate ¶
func (v *StringIsUpperCase) Validate(e *validator.Errors)
Validate adds an error if the Field is not uppercased. Empty string is valid.
type StringIsUserGroupOrWhitelisted ¶
type StringIsUserGroupOrWhitelisted struct { Name string Field string Whitelist []string Message string }
StringIsUserGroupOrWhitelisted is a validator object. Validate adds an error if the Field is not a user group or whitelisted.
func (*StringIsUserGroupOrWhitelisted) SetField ¶
func (v *StringIsUserGroupOrWhitelisted) SetField(s string)
SetField sets validator field.
func (*StringIsUserGroupOrWhitelisted) SetNameIndex ¶
func (v *StringIsUserGroupOrWhitelisted) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsUserGroupOrWhitelisted) Validate ¶
func (v *StringIsUserGroupOrWhitelisted) Validate(e *validator.Errors)
Validate adds an error if the Field is not a user group or whitelisted.
type StringIsValidShadowPassword ¶
StringIsValidShadowPassword is a validator object. Validate adds an error if the Field is not a valid shadow password.
func (*StringIsValidShadowPassword) SetField ¶
func (v *StringIsValidShadowPassword) SetField(s string)
SetField sets validator field.
func (*StringIsValidShadowPassword) SetNameIndex ¶
func (v *StringIsValidShadowPassword) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsValidShadowPassword) Validate ¶
func (v *StringIsValidShadowPassword) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid shadow password.
type StringIsValidUserOrGroupName ¶
StringIsValidUserOrGroupName is a validator object. Validate adds an error if the Field is not a valid user or group name.
func (*StringIsValidUserOrGroupName) SetField ¶
func (v *StringIsValidUserOrGroupName) SetField(s string)
SetField sets validator field.
func (*StringIsValidUserOrGroupName) SetNameIndex ¶
func (v *StringIsValidUserOrGroupName) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringIsValidUserOrGroupName) Validate ¶
func (v *StringIsValidUserOrGroupName) Validate(e *validator.Errors)
Validate adds an error if the Field is not a valid user or group name.
type StringLengthInRange ¶
StringLengthInRange is a validator object. Validate adds an error if the Field length is not in range between Min and Max (inclusive). If only Min provided - Max=length of string. If only Max provided - Min=0. It is possible to provide either both or one of the Min/Max values.
func (*StringLengthInRange) SetField ¶
func (v *StringLengthInRange) SetField(s string)
SetField sets validator field.
func (*StringLengthInRange) SetNameIndex ¶
func (v *StringLengthInRange) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringLengthInRange) Validate ¶
func (v *StringLengthInRange) Validate(e *validator.Errors)
Validate adds an error if the Field length is not in range between Min and Max (inclusive). If only Min provided - Max=length of string. If only Max provided - Min=0. It is possible to provide either both or one of the Min/Max values.
type StringMatchRegex ¶
StringMatchRegex is a validator object. Validate adds an error if the Field does not match regular expression Regex.
func (*StringMatchRegex) SetField ¶
func (v *StringMatchRegex) SetField(s string)
SetField sets validator field.
func (*StringMatchRegex) SetNameIndex ¶
func (v *StringMatchRegex) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringMatchRegex) Validate ¶
func (v *StringMatchRegex) Validate(e *validator.Errors)
Validate adds an error if the Field does not match regular expression Regex.
type StringSliceDive ¶
type StringSliceDive struct { Validator StringValidator Field []string }
StringSliceDive is a validator object
func (*StringSliceDive) Validate ¶
func (v *StringSliceDive) Validate(e *validator.Errors)
Validate applies Validator to each value in the Field.
type StringValidator ¶
type StringValidator interface { Validate(*validator.Errors) SetField(s string) SetNameIndex(i int) }
StringValidator is an interface for string validator objects.
type StringsAreEqual ¶
type StringsAreEqual struct { Name string Field string ComparedName string ComparedField string CaseInsensitive bool Message string }
StringsAreEqual is a validator object. Validate adds an error if the Field is not equal to ComparedField. CaseInsensitive flag can be set to make comparison case insensitive.
func (*StringsAreEqual) SetField ¶
func (v *StringsAreEqual) SetField(s string)
SetField sets validator field.
func (*StringsAreEqual) SetNameIndex ¶
func (v *StringsAreEqual) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringsAreEqual) Validate ¶
func (v *StringsAreEqual) Validate(e *validator.Errors)
Validate adds an error if the Field is not equal to ComparedField. CaseInsensitive flag can be set to make comparison case insensitive.
type StringsAreNotEqual ¶
type StringsAreNotEqual struct { Name string Field string ComparedName string ComparedField string CaseInsensitive bool Message string }
StringsAreNotEqual is a validator object. Validate adds an error if the Field is equal to ComparedField. CaseInsensitive flag can be set to make comparison case insensitive.
func (*StringsAreNotEqual) SetField ¶
func (v *StringsAreNotEqual) SetField(s string)
SetField sets validator field.
func (*StringsAreNotEqual) SetNameIndex ¶
func (v *StringsAreNotEqual) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringsAreNotEqual) Validate ¶
func (v *StringsAreNotEqual) Validate(e *validator.Errors)
Validate adds an error if the Field is equal to ComparedField. CaseInsensitive flag can be set to make comparison case insensitive.
type StringsArePathsInTheSameDir ¶
type StringsArePathsInTheSameDir struct { Name string Field string ComparedName string ComparedField string Message string }
StringsArePathsInTheSameDir is a validator object. Validate adds an error if paths do not share same path tree to last path element. Supplied paths are converted to absolute paths before comparison.
func (*StringsArePathsInTheSameDir) SetField ¶
func (v *StringsArePathsInTheSameDir) SetField(s string)
SetField sets validator field.
func (*StringsArePathsInTheSameDir) SetNameIndex ¶
func (v *StringsArePathsInTheSameDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringsArePathsInTheSameDir) Validate ¶
func (v *StringsArePathsInTheSameDir) Validate(e *validator.Errors)
Validate adds an error if paths do not share same path tree to last path element. Supplied paths are converted to absolute paths before comparison.
type StringsArePathsNotInTheSameDir ¶
type StringsArePathsNotInTheSameDir struct { Name string Field string ComparedName string ComparedField string Message string }
StringsArePathsNotInTheSameDir is a validator object. Validate adds an error if paths share same path tree to last path element. Supplied paths are converted to absolute paths before comparison.
func (*StringsArePathsNotInTheSameDir) SetField ¶
func (v *StringsArePathsNotInTheSameDir) SetField(s string)
SetField sets validator field.
func (*StringsArePathsNotInTheSameDir) SetNameIndex ¶
func (v *StringsArePathsNotInTheSameDir) SetNameIndex(i int)
SetNameIndex sets index of slice element on Name.
func (*StringsArePathsNotInTheSameDir) Validate ¶
func (v *StringsArePathsNotInTheSameDir) Validate(e *validator.Errors)
Validate adds an error if paths share same path tree to last path element. Supplied paths are converted to absolute paths before comparison.
type TimeIsAfterTime ¶
type TimeIsAfterTime struct { Name string Field time.Time ComparedName string ComparedField time.Time Message string }
TimeIsAfterTime is a validator object. Validate adds an error if the Field time is not after the ComparedField time.
func (*TimeIsAfterTime) Validate ¶
func (v *TimeIsAfterTime) Validate(e *validator.Errors)
Validate adds an error if the Field time is not after the ComparedField time.
type TimeIsBeforeTime ¶
type TimeIsBeforeTime struct { Name string Field time.Time ComparedName string ComparedField time.Time Message string }
TimeIsBeforeTime is a validator object. Validate adds an error if the Field time is not before the ComparedField time.
func (*TimeIsBeforeTime) Validate ¶
func (v *TimeIsBeforeTime) Validate(e *validator.Errors)
Validate adds an error if the Field time is not before the ComparedField time.
type TimeIsPresent ¶
TimeIsPresent is a validator object. Validate adds an error if the Field is the time default value.
func (*TimeIsPresent) Validate ¶
func (v *TimeIsPresent) Validate(e *validator.Errors)
Validate adds an error if the Field is the time default value.
type UUIDIsPresent ¶
UUIDIsPresent is a validator object. Validate adds an error if the Field is an uuid default value (uuid.Nil).
func (*UUIDIsPresent) Validate ¶
func (v *UUIDIsPresent) Validate(e *validator.Errors)
Validate adds an error if the Field is an uuid default value (uuid.Nil).
Source Files
¶
- errors.go
- exec_exit_code_has_any.go
- exec_exit_code_has_none_of.go
- exec_exit_code_is_not_zero.go
- exec_exit_code_is_zero.go
- func_validator.go
- number_in_range.go
- number_is_greater.go
- number_is_less.go
- number_is_not_zero.go
- number_is_valid_user_gid.go
- number_is_valid_user_uid.go
- number_slice_dive.go
- numbers.go
- numbers_are_equal.go
- numbers_are_not_equal.go
- patterns.go
- slice_is_not_empty.go
- slice_is_unique.go
- slice_length_in_range.go
- string_contains_any.go
- string_contains_none_of.go
- string_exclusion.go
- string_has_alpha.go
- string_has_lowercase.go
- string_has_no_file_in_path_parents.go
- string_has_no_prefix.go
- string_has_no_suffix.go
- string_has_no_whitespace.go
- string_has_number.go
- string_has_prefix.go
- string_has_prefix_any.go
- string_has_prefix_none_of.go
- string_has_suffix.go
- string_has_suffix_any.go
- string_has_suffix_none_of.go
- string_has_uppercase.go
- string_inclusion.go
- string_is_abs_path.go
- string_is_alpha.go
- string_is_alphanum.go
- string_is_ascii.go
- string_is_base64.go
- string_is_cidr.go
- string_is_cidrv4.go
- string_is_cidrv6.go
- string_is_dir.go
- string_is_dir_with_mode_sticky.go
- string_is_dir_without_mode_sticky.go
- string_is_email.go
- string_is_email_like.go
- string_is_existing_group.go
- string_is_existing_user.go
- string_is_file.go
- string_is_file_and_is_executable.go
- string_is_file_and_is_not_executable.go
- string_is_float.go
- string_is_hash.go
- string_is_hexadecimal.go
- string_is_hexcolor.go
- string_is_http_url.go
- string_is_int.go
- string_is_ip.go
- string_is_ip_global_unicast.go
- string_is_ip_has_ptr.go
- string_is_ip_iface_local_multicast.go
- string_is_ip_link_local_multicast.go
- string_is_ip_link_local_unicast.go
- string_is_ip_loopback.go
- string_is_ip_multicast.go
- string_is_ip_unspec.go
- string_is_ipv4.go
- string_is_ipv6.go
- string_is_json.go
- string_is_lowercase.go
- string_is_mac.go
- string_is_not_dir.go
- string_is_not_existing_group.go
- string_is_not_existing_user.go
- string_is_not_file.go
- string_is_not_numeric.go
- string_is_not_path.go
- string_is_not_regular_user.go
- string_is_not_resolvable_hostname.go
- string_is_not_resolvable_hostname_nor_ip.go
- string_is_not_resolvable_hostname_nor_ipv4.go
- string_is_not_resolvable_hostname_nor_ipv6.go
- string_is_not_symlink.go
- string_is_not_user_group.go
- string_is_null.go
- string_is_numeric.go
- string_is_path.go
- string_is_path_and_char_device.go
- string_is_path_and_device.go
- string_is_path_and_irregular_file.go
- string_is_path_and_is_writable.go
- string_is_path_and_named_pipe.go
- string_is_path_and_not_char_device.go
- string_is_path_and_not_device.go
- string_is_path_and_not_named_pipe.go
- string_is_path_and_not_socket.go
- string_is_path_and_regular_file.go
- string_is_path_and_socket.go
- string_is_path_with_set_gid.go
- string_is_path_with_set_uid.go
- string_is_path_without_set_gid.go
- string_is_path_without_set_uid.go
- string_is_port.go
- string_is_present.go
- string_is_printableascii.go
- string_is_regular_user_or_whitelisted.go
- string_is_resolvable_hostname.go
- string_is_resolvable_hostname_or_ip.go
- string_is_resolvable_hostname_or_ipv4.go
- string_is_resolvable_hostname_or_ipv6.go
- string_is_rgbcolor.go
- string_is_symlink.go
- string_is_symlink_and_target_is_dir.go
- string_is_symlink_and_target_is_not_dir.go
- string_is_symlink_and_target_is_not_path.go
- string_is_symlink_and_target_is_path.go
- string_is_unix_file_permission.go
- string_is_uppercase.go
- string_is_user_group_or_whitelisted.go
- string_is_utf_letternum.go
- string_is_utf_letters.go
- string_is_utf_numeric.go
- string_is_valid_shadow_password.go
- string_is_valid_user_or_group_name.go
- string_length_in_range.go
- string_match_regex.go
- string_slice_dive.go
- strings_are_equal.go
- strings_are_not_equal.go
- strings_are_paths_in_the_same_dir.go
- strings_are_paths_not_in_the_same_dir.go
- test_utils.go
- time_is_after_time.go
- time_is_before_time.go
- time_is_present.go
- uuid_is_present.go
- variables.go