Documentation ¶
Index ¶
- Constants
- func EmptyStringValidator(inp string) bool
- func GetSingleAnswer(question string, validators ...ValidatorFn) string
- func GetSingleNumber(question string, validators ...NumberValidatorFn) int
- func IpAddressBackValidator(inp string) bool
- func IpAddressValidator(inp string) bool
- func Password() string
- func PositiveNumber(inp int) bool
- func PrintColored(str string) string
- func SelectMultipleDialog(question string, opts []string, backItem bool) []int
- func SelectOneDialog(question string, opts []string) int
- func SelectOneDialogWithBack(question string, opts []string) int
- func WiFiPassword() string
- func YesNoBackValidator(inp string) bool
- func YesNoDialog(question string) bool
- func YesNoValidator(inp string) bool
- type NumberValidatorFn
- type ValidatorFn
- type YesNoAnswer
Constants ¶
View Source
const Retries = 5
Variables ¶
This section is empty.
Functions ¶
func EmptyStringValidator ¶
return true if string is not empty and valid, false otherwise
func GetSingleAnswer ¶
func GetSingleAnswer(question string, validators ...ValidatorFn) string
func GetSingleNumber ¶
func GetSingleNumber(question string, validators ...NumberValidatorFn) int
func IpAddressBackValidator ¶
func IpAddressValidator ¶
return true if parsed IP is not nil, false otherwise
func PositiveNumber ¶
func PrintColored ¶
func SelectMultipleDialog ¶
SelectMultipleDialog returns nil when "go back" choosen
func SelectOneDialog ¶
func SelectOneDialogWithBack ¶
SelectOneDialogWithBack returns -1 when "go back" choosen
func WiFiPassword ¶
func WiFiPassword() string
func YesNoBackValidator ¶
func YesNoDialog ¶
func YesNoValidator ¶
Types ¶
type NumberValidatorFn ¶
type ValidatorFn ¶
Validator type will be called on user input return true if valid input, false otherwise
func CreateValidatorFn ¶
func CreateValidatorFn(fn func(string) error) ValidatorFn
func SpecialCharacterValidator ¶
func SpecialCharacterValidator(str string, cond bool) ValidatorFn
type YesNoAnswer ¶
type YesNoAnswer int
const ( AnswerNo YesNoAnswer = iota AnswerYes AnswerBack )
func YesNoBackDialog ¶
func YesNoBackDialog(question string) YesNoAnswer
Click to show internal directories.
Click to hide internal directories.