Documentation ¶
Index ¶
- Constants
- Variables
- func ApiMethodValidator(val string) error
- func BucketTypeValidator(val string) error
- func CodeTypeValidator(val string) error
- func FQDNValidator(val string) error
- func InList(value string, values []string) bool
- func IsAny(val string, tests ...func(val string) bool) bool
- func IsBytes(val string) bool
- func IsInt(val string) bool
- func MatchAllString(val string, expressions [][]string) error
- func MethodTypeValidator(val string) error
- func RequiredNoCharLimit(val string) error
- func SizeUnitValidator(val string) error
- func SliceContains(slice []string, str string) bool
- func Time(s string) error
- func ValidateFlag(action func(c *cli.Context) error, validators ...Validator) func(c *cli.Context) error
- func VariableBool(val string) error
- func VariableDescriptionValidator(val string) error
- func VariableFQDN(s string) error
- func VariableIntValidator(val string) error
- func VariableMatchValidator(val string) error
- func VariableMaxValidator(val string) error
- func VariableMinValidator(val string) error
- func VariableNameValidator(val string) error
- func VariablePathValidator(path string) error
- func VariableProviderValidator(val string) error
- func VariableRequiredValidator(val string) error
- func VariableSizeValidator(val string) error
- func VariableTagsValidator(val []string) error
- func VariableTime(val string) error
- func VariableTypeValidator(val string) error
- type StringValidator
- type Validator
- func FlagApiMethodValidator(name string) Validator
- func FlagBasicNoCharLimit(name string) Validator
- func FlagBasicValidator(name string) Validator
- func FlagBoolValidator(name string) Validator
- func FlagBucketValidator(name string) Validator
- func FlagCodeTypeValidator(name string) Validator
- func FlagDescriptionValidator(name string) Validator
- func FlagEntryPointValidator(name string) Validator
- func FlagFQDNValidator(name string) Validator
- func FlagIntValidator(name string) Validator
- func FlagMethodTypeValidator(name string) Validator
- func FlagNameValidator(name string) Validator
- func FlagPathValidator(name string) Validator
- func FlagPathsValidator(name string) Validator
- func FlagProviderValidator(name string) Validator
- func FlagSizeValidator(name string) Validator
- func FlagTagsValidator(name string) Validator
- func FlagTimeValidator(name string) Validator
- func FlagTypeValidator(name string) Validator
- func FlagUnitSizeValidator(name string) Validator
Constants ¶
View Source
const ( GreaterThan250 = "must be less than 250 characters" Between0And250 = "must be between 0 and 250 characters" InvalidInput = "invalid input" InvalidMinValue = "invalid `%s` min value: %s" InvalidMaxValue = "invalid `%s` max value: %s" MustStartWithALetter = "Must start with a letter" CanOnlyContainLettersNumbersAndUnderscores = "Can only contain letters, numbers, underscores, and dashes" CanOnlyContainLettersNumbersSpacesAndUnderscores = "Can only contain letters, numbers, spaces, and underscores" PathMustStartWithSlash = "path `%s` is not valid, should start with /" InvalidTimeInput = "`%s` is an invalid time input: %s" InvalidBoolInput = "`%s` is an invalid boolean input: %s" ProviderNotSupported = "provider `%s` not supported" InvalidIntegerValue = "invalid integer value: `%s`, conversion failed with: %s" InvalidSizeUnit = "invalid size unit: `%s` must be one of: %v" InvalidFqdn = "invalid Fqdn: `%s`" NoEmpty = "cannot be empty" InvalidMethodType = "invalid method type: `%s` must be one of: %v" InvalidApiMethodType = "invalid api method type: `%s` must be one of: %v" InvalidCodeType = "invalid code type: `%s` must be one of: %v" InvalidBucketType = "invalid bucket type: `%s` must be one of: %v" InvalidSize = "invalid size: `%s` Ex:(10, 10GB, 10PB)" NotAValidFQDN = "`%s` is not a valid fqdn" )
Variables ¶
View Source
var DescRegex = [][]string{ {CanOnlyContainLettersNumbersSpacesAndUnderscores, is_description}, }
View Source
var NameRegex = [][]string{ {MustStartWithALetter, start_with_letter}, {CanOnlyContainLettersNumbersAndUnderscores, contain_letters_numbers_underscores_dashes}, }
View Source
var TagRegex = [][]string{ {CanOnlyContainLettersNumbersAndUnderscores, contain_letters_numbers_underscores_dashes}, }
Functions ¶
func ApiMethodValidator ¶
func BucketTypeValidator ¶
func CodeTypeValidator ¶
func FQDNValidator ¶
func MatchAllString ¶
func MethodTypeValidator ¶
func RequiredNoCharLimit ¶
func SizeUnitValidator ¶
func SliceContains ¶
func ValidateFlag ¶
func ValidateFlag(action func(c *cli.Context) error, validators ...Validator) func(c *cli.Context) error
EXAMPLE USAGE: ValidateFlag(NewProject,VariableNameValidator("name"),VariableDescriptionValidator("description"), VariableTagsValidator("tags"))
func VariableBool ¶
func VariableFQDN ¶
func VariableIntValidator ¶
func VariableMatchValidator ¶
func VariableMaxValidator ¶
func VariableMinValidator ¶
func VariableNameValidator ¶
func VariablePathValidator ¶
func VariableSizeValidator ¶
func VariableTagsValidator ¶
func VariableTime ¶
func VariableTypeValidator ¶
Types ¶
type StringValidator ¶
type Validator ¶
type Validator func(c *cli.Context) error
func FlagApiMethodValidator ¶
func FlagBasicNoCharLimit ¶
func FlagBasicValidator ¶
func FlagBoolValidator ¶
func FlagBucketValidator ¶
func FlagCodeTypeValidator ¶
func FlagEntryPointValidator ¶
func FlagFQDNValidator ¶
func FlagIntValidator ¶
func FlagMethodTypeValidator ¶
func FlagNameValidator ¶
func FlagPathValidator ¶
func FlagPathsValidator ¶
func FlagProviderValidator ¶
func FlagSizeValidator ¶
func FlagTagsValidator ¶
func FlagTimeValidator ¶
func FlagTypeValidator ¶
func FlagUnitSizeValidator ¶
Click to show internal directories.
Click to hide internal directories.