Documentation ¶
Index ¶
- Constants
- type Prompt
- type PromptImp
- func (p *PromptImp) Confirm(question, trueOption, falseOption string) (resultVal bool, err error)
- func (p *PromptImp) InputExistingFilePath(label string) (result string, err error)
- func (p *PromptImp) InputExistingFilePathDefault(label string, defaultVal string) (result string, err error)
- func (p *PromptImp) InputFloat64(label string) (resultVal float64, err error)
- func (p *PromptImp) InputInt(label string) (resultVal int, err error)
- func (p *PromptImp) InputInt64(label string) (resultVal int64, err error)
- func (p *PromptImp) InputIntDefault(label string, defVal int) (resultVal int, err error)
- func (p *PromptImp) InputIntDefaultRange(label string, defVal, min, max int) (resultVal int, err error)
- func (p *PromptImp) InputIntDefaultValidation(label string, defVal int, valFunc func(input string) error) (resultVal int, err error)
- func (p *PromptImp) InputIntRange(label string, min, max int) (resultVal int, err error)
- func (p *PromptImp) InputPassword(label string) (result string, err error)
- func (p *PromptImp) InputPasswordRegex(label string, regexCheck string) (result string, err error)
- func (p *PromptImp) InputPasswordRegexErrMsg(label string, regexCheck string, errMsg string) (result string, err error)
- func (p *PromptImp) InputString(label string) (result string, err error)
- func (p *PromptImp) InputStringDefault(label string, defaultVal string) (result string, err error)
- func (p *PromptImp) InputStringMinMax(label string, minlen int, maxlen int) (result string, err error)
- func (p *PromptImp) InputStringRegex(label string, regexCheck string) (result string, err error)
- func (p *PromptImp) InputStringRegexDefault(label string, regexCheck string, defaultVal string) (result string, err error)
- func (p *PromptImp) InputStringRegexDefaultErrMsg(label string, regexCheck string, defaultVal string, errMsg string) (result string, err error)
- func (p *PromptImp) InputStringRegexErrMsg(label string, regexCheck string, errMsg string) (result string, err error)
- func (p *PromptImp) InputStringRequired(label string) (result string, err error)
- func (p *PromptImp) InputWord(label string) (result string, err error)
- func (p *PromptImp) InputWordDefault(label string, defaultVal string) (result string, err error)
- func (p *PromptImp) Select(question string, options ...string) (index int, result string, err error)
- func (p *PromptImp) SelectAdd(question string, addLabel string, options ...string) (index int, result string, err error)
- func (p *PromptImp) SelectSearch(question string, options ...string) (index int, result string, err error)
Constants ¶
View Source
const ( FAIL_MSG = "prompt failed %v" INVALID_INT = "invalid int" PARSE_INT_FAIL = "parse int failed %v" REGEX_CHECK_FAIL = "input value failed to match with expected pattern (%v)" REGEX_CHECK_FAIL_WITH_SAMPLE_STRING = "regex check failed. sample value: %v" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt interface { Confirm(question, trueOption, falseOption string) (result bool, err error) Select(question string, options ...string) (index int, result string, err error) SelectSearch(question string, options ...string) (index int, result string, err error) SelectAdd(question string, addLabel string, options ...string) (index int, result string, err error) InputInt64(label string) (resultVal int64, err error) InputInt(label string) (resultVal int, err error) InputIntDefault(label string, defVal int) (resultVal int, err error) InputIntDefaultValidation(label string, defVal int, valFunc func(input string) error) (resultVal int, err error) InputIntRange(label string, min, max int) (resultVal int, err error) InputIntDefaultRange(label string, defVal, min, max int) (resultVal int, err error) InputFloat64(label string) (resultVal float64, err error) InputStringMinMax(label string, minlen int, maxlen int) (result string, err error) InputWordDefault(label string, defaultVal string) (result string, err error) InputWord(label string) (result string, err error) InputStringRegex(label string, regexCheck string) (result string, err error) InputStringRegexErrMsg(label string, regexCheck string, errMsg string) (result string, err error) InputString(label string) (result string, err error) InputStringRequired(label string) (result string, err error) InputPassword(label string) (result string, err error) InputPasswordRegex(label string, regexCheck string) (result string, err error) InputPasswordRegexErrMsg(label string, regexCheck string, errMsg string) (result string, err error) InputStringRegexDefault(label string, regexCheck string, defaultVal string) (result string, err error) InputStringRegexDefaultErrMsg(label string, regexCheck string, defaultVal string, errMsg string) (result string, err error) InputStringDefault(label string, defaultVal string) (result string, err error) InputExistingFilePathDefault(label string, defaultVal string) (result string, err error) InputExistingFilePath(label string) (result string, err error) }
type PromptImp ¶
type PromptImp struct { Stdin io.ReadCloser Stdout io.WriteCloser FileUtils fileutils.FileUtils }
func PromptFactory ¶
func PromptFactory(in io.ReadCloser, out io.WriteCloser, fu fileutils.FileUtils) *PromptImp
func (*PromptImp) InputExistingFilePath ¶
func (*PromptImp) InputExistingFilePathDefault ¶
func (*PromptImp) InputFloat64 ¶
func (*PromptImp) InputInt64 ¶
func (*PromptImp) InputIntDefault ¶
func (*PromptImp) InputIntDefaultRange ¶
func (*PromptImp) InputIntDefaultValidation ¶
func (*PromptImp) InputIntRange ¶
func (*PromptImp) InputPassword ¶
func (*PromptImp) InputPasswordRegex ¶
func (*PromptImp) InputPasswordRegexErrMsg ¶
func (*PromptImp) InputString ¶
func (*PromptImp) InputStringDefault ¶
func (*PromptImp) InputStringMinMax ¶
func (*PromptImp) InputStringRegex ¶
func (*PromptImp) InputStringRegexDefault ¶
func (*PromptImp) InputStringRegexDefaultErrMsg ¶
func (*PromptImp) InputStringRegexErrMsg ¶
func (*PromptImp) InputStringRequired ¶
func (*PromptImp) InputWordDefault ¶
Click to show internal directories.
Click to hide internal directories.