dialogs

package
v0.0.0-...-445020f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2017 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const Retries = 5

Variables

This section is empty.

Functions

func EmptyStringValidator

func EmptyStringValidator(inp string) bool

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 IpAddressBackValidator(inp string) bool

func IpAddressValidator

func IpAddressValidator(inp string) bool

return true if parsed IP is not nil, false otherwise

func Password

func Password() string

func PositiveNumber

func PositiveNumber(inp int) bool

func PrintColored

func PrintColored(str string) string

func SelectMultipleDialog

func SelectMultipleDialog(question string, opts []string, backItem bool) []int

SelectMultipleDialog returns nil when "go back" choosen

func SelectOneDialog

func SelectOneDialog(question string, opts []string) int

func SelectOneDialogWithBack

func SelectOneDialogWithBack(question string, opts []string) int

SelectOneDialogWithBack returns -1 when "go back" choosen

func WiFiPassword

func WiFiPassword() string

func YesNoBackValidator

func YesNoBackValidator(inp string) bool

func YesNoDialog

func YesNoDialog(question string) bool

func YesNoValidator

func YesNoValidator(inp string) bool

Types

type NumberValidatorFn

type NumberValidatorFn func(input int) bool

type ValidatorFn

type ValidatorFn func(input string) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL