Documentation
¶
Index ¶
- func HandleCliError(err error)
- func PromptForBool(promptMsg string) (bool, error)
- func PromptForInt(promptMsg string, placeHolder string, required bool) (int, error)
- func PromptForJson(promptMsg string, placeholder string, required bool) (string, error)
- func PromptForOption[T comparable](promptMsg string, options []huh.Option[T], required bool) (T, error)
- func PromptForOptions[T comparable](promptMsg string, options []huh.Option[T], min int, limit int) ([]T, error)
- func PromptForString(promptMsg string, placeHolder string, required bool) (string, error)
- func PromptForUrl(promptMsg string, placeHolder string, withTrailingSlash bool) (string, error)
- func ValidateEmptyString(s string) error
- func ValidateJson(s string, allowEmpty bool) error
- func ValidateStruct(s any) error
- func ValidateUrl(s string) error
- func ValidateVar(field any, tag string) error
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleCliError ¶
func HandleCliError(err error)
HandleCliError will log and exit the program appropriately based on the error. It will skip if the error is nil. It takes a verbose flag for logging the entire error chain or just the root cause.
func PromptForBool ¶
func PromptForInt ¶
func PromptForJson ¶
func PromptForOption ¶
func PromptForOptions ¶
func PromptForString ¶
func PromptForUrl ¶
func ValidateEmptyString ¶
func ValidateJson ¶
ValidateJson validates if unmarshaling the text into JSON causes en error. It also takes a param to allow for empty text to pass, making it optional.
func ValidateStruct ¶
ValidateStruct validates a struct using the validator package
func ValidateUrl ¶
func ValidateVar ¶
ValidateVar validates a single variable using the validator package
Types ¶
type Target ¶
Target represents a user-specified target: either a whole flow or a specific step.
func FlattenTargets ¶
flattenTargets expands targets into individual targets, excluding skipped ones.
func ParseTarget ¶
ParseTarget parses a single target string like "flow" or "flow/step".