Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewValidationError ¶
NewValidationError provides a convenient helper function to create flag validation errors usable by run.Config implementations.
Types ¶
type Set ¶ added in v0.2.0
Set holds a pflag.FlagSet as well as an exported Name variable for allowing improved help usage information.
func (*Set) SensitiveStringVar ¶ added in v0.2.0
func (*Set) SensitiveStringVarP ¶ added in v0.2.0
type ValidationError ¶
type ValidationError string
ValidationError provides the ability to create constant errors for run.Group validation errors, e.g. incorrect flag values.
const ( // FlagErr can be used as formatting string for flag related validation // errors where the first variable lists the flag name and the second // variable is the actual error. FlagErr = "--%s error: %w" // ErrRequired is returned when required config options are not provided. ErrRequired ValidationError = "required" // ErrInvalidPath is returned when a path config option is invalid. ErrInvalidPath ValidationError = "invalid path" // ErrInvalidVal is returned when the value passed into a flag argument is invalid. ErrInvalidVal ValidationError = "invalid value" )
func (ValidationError) Error ¶
func (v ValidationError) Error() string
Error implements the built-in error interface.
Click to show internal directories.
Click to hide internal directories.