{"modulePath":"github.com/hookdeck/hookdeck-cli","version":"v1.9.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package validators\n\n## Variables\n\n```go\nvar (\n\t// ErrAPIKeyNotConfigured is the error returned when the loaded profile is missing the api key property\n\tErrAPIKeyNotConfigured = errors.New(\"you aren't authenticated yet\")\n\t// ErrDeviceNameNotConfigured is the error returned when the loaded profile is missing the device name property\n\tErrDeviceNameNotConfigured = errors.New(\"you have not configured your device name yet\")\n)\n```\n\n## Functions\n\n```go\nfunc APIKey(input string) error\n```\nAPIKey validates that a string looks like an API key.\n\n```go\nfunc APIKeyNotRestricted(input string) error\n```\nAPIKeyNotRestricted validates that a string looks like a secret API key and is not a restricted key.\n\n```go\nfunc Account(account string) error\n```\nAccount validates that a string is an acceptable account filter.\n\n```go\nfunc CallNonEmpty(validator ArgValidator, value string) error\n```\nCallNonEmpty calls an argument validator on a string if the string is not empty.\n\n```go\nfunc CallNonEmptyArray(validator ArgValidator, values []string) error\n```\nCallNonEmptyArray calls an argument validator on all non-empty elements of a string array.\n\n```go\nfunc ExactArgs(num int) cobra.PositionalArgs\n```\nExactArgs is a validator for commands to print an error when the number provided is different than the arguments passed in\n\n```go\nfunc HTTPMethod(method string) error\n```\nHTTPMethod validates that a string is an acceptable HTTP method.\n\n```go\nfunc MaximumNArgs(num int) cobra.PositionalArgs\n```\nMaximumNArgs is a validator for commands to print an error when the provided args are greater than the maximum amount\n\n```go\nfunc NoArgs(cmd *cobra.Command, args []string) error\n```\nNoArgs is a validator for commands to print an error when an argument is provided\n\n```go\nfunc RequestSource(source string) error\n```\nRequestSource validates that a string is an acceptable request source.\n\n```go\nfunc RequestStatus(status string) error\n```\nRequestStatus validates that a string is an acceptable request status.\n\n```go\nfunc StatusCode(code string) error\n```\nStatusCode validates that a provided status code is within the range of those used in the Hookdeck API.\n\n```go\nfunc StatusCodeType(code string) error\n```\nStatusCodeType validates that a provided status code type is one of those used in the Hookdeck API.\n\n## Types\n\n```go\ntype ArgValidator func(string) error\n```\nArgValidator is an argument validator. It accepts a string and returns an error if the string is invalid, or nil otherwise.\n\n","path":"github.com/hookdeck/hookdeck-cli/pkg/validators","name":"validators","synopsis":"","isRedistributable":true}
