Documentation
¶
Overview ¶
Package prompt inputs for user interactions.
Index ¶
- Constants
- Variables
- func CtrlC()
- func IndexStrings(options *[]string, setup bool) string
- func Port(validate, setup bool) (port uint)
- func PortValid(port uint) (ok bool)
- func ShortStrings(options *[]string) string
- func SkipSet(setup bool) string
- func String() (words string)
- func Strings(options *[]string, setup bool) string
- func YesNo(ask string, yesDefault bool) bool
Examples ¶
Constants ¶
View Source
const ( PortMin uint = 1 // port 0 is not valid as viper treats it as a null value PortMax uint = 65535 NoChange = "no changes applied" )
the lowest, largest and recommended network ports to serve HTTP.
Variables ¶
View Source
var ( ErrNoReader = errors.New("reader interface is empty") ErrPString = errors.New("prompt string standard input problem") )
Functions ¶
func CtrlC ¶ added in v0.0.33
func CtrlC()
CtrlC intercepts any Ctrl-C keyboard input and exits to the shell.
func IndexStrings ¶
IndexStrings asks for a numeric index position and returns a single choice from a string of keys.
func ShortStrings ¶
ShortStrings asks for and returns a single choice from a string of keys. Either the first letter or the full name of the key are accepted.
func SkipSet ¶ added in v0.0.33
SkipSet returns a skipped setting string for the setup walk through.
func String ¶
func String() (words string)
String asks for and returns a multi-word string. Inputting ⏎ the Enter/Return key exits the program, or returns an empty value when in SetupMode.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.