Versions in this module Expand all Collapse all v2 v2.2.13 Jun 14, 2021 Changes in this version + var ConfirmQuestionTemplate = ... + var EditorQuestionTemplate = ... + var ErrorTemplate = ... + var InputQuestionTemplate = ... + var MultiSelectQuestionTemplate = ... + var MultilineQuestionTemplate = ... + var PasswordQuestionTemplate = ... + var SelectQuestionTemplate = ... + func Ask(qs []*Question, response interface{}, opts ...AskOpt) error + func AskOne(p Prompt, response interface{}, opts ...AskOpt) error + func Required(val interface{}) error + func Title(ans interface{}) interface + func ToLower(ans interface{}) interface + type AskOpt func(options *AskOptions) error + func WithFilter(filter func(filter string, value string, index int) (include bool)) AskOpt + func WithHelpInput(r rune) AskOpt + func WithIcons(setIcons func(*IconSet)) AskOpt + func WithKeepFilter(KeepFilter bool) AskOpt + func WithPageSize(pageSize int) AskOpt + func WithShowCursor(ShowCursor bool) AskOpt + func WithStdio(in terminal.FileReader, out terminal.FileWriter, err io.Writer) AskOpt + func WithValidator(v Validator) AskOpt + type AskOptions struct + PromptConfig PromptConfig + Stdio terminal.Stdio + Validators []Validator + type Confirm struct + Default bool + Help string + Message string + func (c *Confirm) Cleanup(config *PromptConfig, val interface{}) error + func (c *Confirm) Prompt(config *PromptConfig) (interface{}, error) + type ConfirmTemplateData struct + Answer string + Config *PromptConfig + ShowHelp bool + type Editor struct + AppendDefault bool + Default string + Editor string + FileName string + Help string + HideDefault bool + Message string + func (e *Editor) Cleanup(config *PromptConfig, val interface{}) error + func (e *Editor) Prompt(config *PromptConfig) (interface{}, error) + func (e *Editor) PromptAgain(config *PromptConfig, invalid interface{}, err error) (interface{}, error) + type EditorTemplateData struct + Answer string + Config *PromptConfig + ShowAnswer bool + ShowHelp bool + type ErrorTemplateData struct + Error error + Icon Icon + type Icon struct + Format string + Text string + type IconSet struct + Error Icon + Help Icon + HelpInput Icon + MarkedOption Icon + Question Icon + SelectFocus Icon + UnmarkedOption Icon + type Input struct + Default string + Help string + Message string + Suggest func(toComplete string) []string + func (i *Input) Cleanup(config *PromptConfig, val interface{}) error + func (i *Input) OnChange(key rune, config *PromptConfig) (bool, error) + func (i *Input) Prompt(config *PromptConfig) (interface{}, error) + type InputTemplateData struct + Answer string + Config *PromptConfig + PageEntries []core.OptionAnswer + SelectedIndex int + ShowAnswer bool + ShowHelp bool + type MultiSelect struct + Default interface{} + Filter func(filter string, value string, index int) bool + FilterMessage string + Help string + Message string + Options []string + PageSize int + VimMode bool + func (m *MultiSelect) Cleanup(config *PromptConfig, val interface{}) error + func (m *MultiSelect) OnChange(key rune, config *PromptConfig) + func (m *MultiSelect) Prompt(config *PromptConfig) (interface{}, error) + type MultiSelectTemplateData struct + Answer string + Checked map[int]bool + Config *PromptConfig + PageEntries []core.OptionAnswer + SelectedIndex int + ShowAnswer bool + ShowHelp bool + type Multiline struct + Default string + Help string + Message string + func (i *Multiline) Cleanup(config *PromptConfig, val interface{}) error + func (i *Multiline) Prompt(config *PromptConfig) (interface{}, error) + type MultilineTemplateData struct + Answer string + Config *PromptConfig + ShowAnswer bool + ShowHelp bool + type OptionAnswer = core.OptionAnswer + type Password struct + Help string + Message string + func (p *Password) Prompt(config *PromptConfig) (interface{}, error) + func (prompt *Password) Cleanup(config *PromptConfig, val interface{}) error + type PasswordTemplateData struct + Config *PromptConfig + ShowHelp bool + type Prompt interface + Cleanup func(*PromptConfig, interface{}) error + Error func(*PromptConfig, error) error + Prompt func(config *PromptConfig) (interface{}, error) + type PromptAgainer interface + PromptAgain func(config *PromptConfig, invalid interface{}, err error) (interface{}, error) + type PromptConfig struct + Filter func(filter string, option string, index int) bool + HelpInput string + Icons IconSet + KeepFilter bool + PageSize int + ShowCursor bool + SuggestInput string + type Question struct + Name string + Prompt Prompt + Transform Transformer + Validate Validator + type Renderer struct + func (r *Renderer) AppendRenderedText(text string) + func (r *Renderer) Error(config *PromptConfig, invalid error) error + func (r *Renderer) NewCursor() *terminal.Cursor + func (r *Renderer) NewRuneReader() *terminal.RuneReader + func (r *Renderer) Render(tmpl string, data interface{}) error + func (r *Renderer) Stdio() terminal.Stdio + func (r *Renderer) WithStdio(stdio terminal.Stdio) + type Select struct + Default interface{} + Filter func(filter string, value string, index int) bool + FilterMessage string + Help string + Message string + Options []string + PageSize int + VimMode bool + func (s *Select) Cleanup(config *PromptConfig, val interface{}) error + func (s *Select) OnChange(key rune, config *PromptConfig) bool + func (s *Select) Prompt(config *PromptConfig) (interface{}, error) + type SelectTemplateData struct + Answer string + Config *PromptConfig + PageEntries []core.OptionAnswer + SelectedIndex int + ShowAnswer bool + ShowHelp bool + type Transformer func(ans interface{}) (newAns interface{}) + func ComposeTransformers(transformers ...Transformer) Transformer + func TransformString(f func(s string) string) Transformer + type Validator func(ans interface{}) error + func ComposeValidators(validators ...Validator) Validator + func MaxLength(length int) Validator + func MinLength(length int) Validator Other modules containing this package github.com/bmwiedemann/survey