Documentation
¶
Index ¶
- func Capability() validator.String
- func IfParentDefined(validators ...validator.String) validator.String
- func IsURL(requireHTTPS bool) validator.String
- func Name() validator.String
- func UIDP(allowRootSentinel bool) validator.String
- func ValidRegExp() validator.String
- func ValidateStringFuncs(fns ...ValidateStringFunc) validator.String
- type ValidateStringFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capability ¶
Capability validates the string value is a valid role capability.
func IfParentDefined ¶
IfParentDefined executes the given set of validators only if the parent of the attribute this validator is defined for is itself defined. This is useful for validating attributes within a block that is mutually exclusive with other blocks.
func IsURL ¶
IsURL validates the given attribute is a valid URL of the form http[s]://host.tld If requiresHTTPS is true, the scheme must be https.
func UIDP ¶
UIDP validates the string value is a valid Chainguard UIDP. allowRootSentinel allows "/" as a valid UIDP, which for some endpoints signals root.
func ValidRegExp ¶
ValidRegExp validates the string value is a compilable regular expression.
func ValidateStringFuncs ¶
func ValidateStringFuncs(fns ...ValidateStringFunc) validator.String
ValidateStringFuncs executes the given set of ValidateStringFunc. Useful for one-off string validation functions that can accept a string and return an error.