Documentation
¶
Index ¶
- Variables
- func Confirm(message string, defaultValue bool) (bool, error)
- func Editor(message, defaultValue string) (string, error)
- func Input(message, defaultValue string, validator survey.Validator) (string, error)
- func InputWithHelp(message, defaultValue, help string, validator survey.Validator) (string, error)
- func MultiSelect(message string, options []string) ([]string, error)
- func Password(message string) (string, error)
- func PasswordWithHelp(message, help string) (string, error)
- func PrintDebugf(format string, args ...interface{})
- func PrintErrorf(format string, args ...interface{})
- func PrintHeader(text string)
- func PrintInfof(format string, args ...interface{})
- func PrintKeyValue(key, value string)
- func PrintList(items []string)
- func PrintNumberedList(items []string)
- func PrintSubheader(text string)
- func PrintSuccessf(format string, args ...interface{})
- func PrintWarningf(format string, args ...interface{})
- func Required(val interface{}) error
- func Select(message string, options []string) (string, error)
- func SelectWithHelp(message string, options []string, help string) (string, error)
- func StartSpinner(message string) *spinner.Spinner
- func StopSpinner(s *spinner.Spinner, message string)
- func StopSpinnerError(s *spinner.Spinner, message string)
Constants ¶
This section is empty.
Variables ¶
var ( Success = color.New(color.FgGreen).SprintFunc() Error = color.New(color.FgRed).SprintFunc() Warning = color.New(color.FgYellow).SprintFunc() Info = color.New(color.FgCyan).SprintFunc() Bold = color.New(color.Bold).SprintFunc() )
Colors for consistent output
var Stderr io.Writer = os.Stderr
Stderr is the destination for PrintError. Defaults to os.Stderr; tests swap.
var Stdout io.Writer = os.Stdout
Stdout is the destination for Print* helpers. Defaults to os.Stdout; tests swap to a buffer to capture output.
Functions ¶
func InputWithHelp ¶
InputWithHelp asks for text input with help text
func MultiSelect ¶
MultiSelect presents a multi-selection list
func PasswordWithHelp ¶
PasswordWithHelp asks for password input with help text
func PrintDebugf ¶
func PrintDebugf(format string, args ...interface{})
PrintDebugf prints a debug message
func PrintErrorf ¶
func PrintErrorf(format string, args ...interface{})
PrintErrorf prints an error message
func PrintInfof ¶
func PrintInfof(format string, args ...interface{})
PrintInfof prints an info message
func PrintNumberedList ¶
func PrintNumberedList(items []string)
PrintNumberedList prints a numbered list of items
func PrintSuccessf ¶
func PrintSuccessf(format string, args ...interface{})
PrintSuccessf prints a success message
func PrintWarningf ¶
func PrintWarningf(format string, args ...interface{})
PrintWarningf prints a warning message
func Required ¶
func Required(val interface{}) error
Required is a validator that ensures input is not empty
func SelectWithHelp ¶
SelectWithHelp presents a selection list with help text
func StartSpinner ¶
StartSpinner starts a loading spinner with a message
func StopSpinner ¶
StopSpinner stops a spinner with a success message
func StopSpinnerError ¶
StopSpinnerError stops a spinner with an error message
Types ¶
This section is empty.