Documentation ¶
Index ¶
- Constants
- Variables
- func ChooseFromList(message string, options []string, colourOverrides ...string) (int, string, error)
- func ChooseFromMultiList(message string, options []string, colourOverrides ...string) ([]int, []string, error)
- func EnterInput(msg string) string
- func EnterInputWithDefault(msg, defaultValue string) string
- func EnterPassword(msg string) string
- func EnterPasswordE(msg string) (string, error)
Constants ¶
const ( SPACE = 32 UP = 65 DOWN = 66 ESCAPE = 27 RETURN = 13 A = 97 U = 117 ROW_OFFSET = 2 DEFAULT_COLUMN = 0 )
Variables ¶
var ErrNoOptionsProvided = fmt.Errorf("no options were provided")
var ErrUserCancelled = fmt.Errorf("User cancelled")
ErrUserCancelled means the user cancelled the current action
var ErrUserChoiceInvalid = fmt.Errorf("User choice invalid")
ErrUserChoiceInvalid means the user chose an option which was not valid
Functions ¶
func ChooseFromList ¶
func ChooseFromList(message string, options []string, colourOverrides ...string) (int, string, error)
ChooseFromList prompts the user to select an item from a list. It return the chosen list index, the chosen list item value, or an error
func ChooseFromMultiList ¶
func EnterInput ¶
EnterInput requests input from the user with the given message, and returns any user input that was gathered until a newline was entered
func EnterInputWithDefault ¶
EnterInputWithDefault requests input from the user with the given message and returns a default if the input is empty
func EnterPassword ¶
EnterPassword requests input from the user with the given message, hiding that input, and returns any user input that was gathered until a newline was entered
func EnterPasswordE ¶ added in v1.5.0
EnterPasswordE requests input from the user with the given message, hiding that input, and returns any user input that was gathered until a newline was entered - returning an error if one occurred
Types ¶
This section is empty.