Documentation ¶
Index ¶
- func Always(prompt *Prompt) bool
- func AnsweredValueIs(prompt *Prompt, key string, value string) bool
- func Ask(prompt *Prompt, out io.Writer, in io.Reader) error
- func BaseOptionValidator(p *Prompt, val string) (bool, error)
- func CaseInsensitveTextOptionValidator(p *Prompt, val string) (bool, error)
- type ByText
- type FilterFunc
- type Option
- type Prompt
- func (p *Prompt) AddSubPrompt(prompt *Prompt)
- func (p *Prompt) AvailableOptions() []Option
- func (p *Prompt) DefaultOption() (*Option, bool)
- func (p *Prompt) DefaultValue() (string, bool)
- func (p *Prompt) GetAnswer(key string) string
- func (p *Prompt) Itr() func() *Prompt
- func (p *Prompt) LookupAnswer(key string) (string, bool)
- func (p *Prompt) OptionsToStrings() []string
- func (p *Prompt) Record(answer string) bool
- func (p *Prompt) String() string
- func (p *Prompt) SubPrompts() []Prompt
- func (p *Prompt) ValueOf(t string) string
- func (p *Prompt) VarMap() map[string]string
- type PromptBuilder
- func (b *PromptBuilder) AddDefaultOption(text string, value string) *PromptBuilder
- func (b *PromptBuilder) AddOption(text string, value string) *PromptBuilder
- func (b *PromptBuilder) AskWhen(filter FilterFunc) *PromptBuilder
- func (b *PromptBuilder) Build() (*Prompt, error)
- func (b *PromptBuilder) Context(ctx *PromptsContext) *PromptBuilder
- func (b *PromptBuilder) Path(p string) *PromptBuilder
- func (b *PromptBuilder) Text(t string) *PromptBuilder
- func (b *PromptBuilder) Textf(format string, a ...interface{}) *PromptBuilder
- func (b *PromptBuilder) WithDefault(val string) *PromptBuilder
- func (b *PromptBuilder) WithLogging() *PromptBuilder
- func (b *PromptBuilder) WithOptions(optionFunc ValueGetter) *PromptBuilder
- func (b *PromptBuilder) WithValidator(f ValidatorFunc) *PromptBuilder
- type PromptsContext
- type ValidatorFunc
- type ValueGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilterFunc ¶ added in v0.1.26
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
type Prompt ¶
type Prompt struct {
// contains filtered or unexported fields
}
func (*Prompt) AddSubPrompt ¶
func (*Prompt) AvailableOptions ¶
func (*Prompt) DefaultOption ¶ added in v0.1.26
func (*Prompt) DefaultValue ¶ added in v0.1.26
func (*Prompt) OptionsToStrings ¶ added in v0.1.26
func (*Prompt) SubPrompts ¶ added in v0.1.26
type PromptBuilder ¶
type PromptBuilder struct {
// contains filtered or unexported fields
}
func NewPromptBuilder ¶
func NewPromptBuilder() *PromptBuilder
func (*PromptBuilder) AddDefaultOption ¶
func (b *PromptBuilder) AddDefaultOption(text string, value string) *PromptBuilder
func (*PromptBuilder) AddOption ¶
func (b *PromptBuilder) AddOption(text string, value string) *PromptBuilder
func (*PromptBuilder) AskWhen ¶
func (b *PromptBuilder) AskWhen(filter FilterFunc) *PromptBuilder
func (*PromptBuilder) Build ¶
func (b *PromptBuilder) Build() (*Prompt, error)
func (*PromptBuilder) Context ¶
func (b *PromptBuilder) Context(ctx *PromptsContext) *PromptBuilder
func (*PromptBuilder) Path ¶
func (b *PromptBuilder) Path(p string) *PromptBuilder
func (*PromptBuilder) Text ¶
func (b *PromptBuilder) Text(t string) *PromptBuilder
func (*PromptBuilder) Textf ¶
func (b *PromptBuilder) Textf(format string, a ...interface{}) *PromptBuilder
func (*PromptBuilder) WithDefault ¶ added in v0.1.26
func (b *PromptBuilder) WithDefault(val string) *PromptBuilder
func (*PromptBuilder) WithLogging ¶
func (b *PromptBuilder) WithLogging() *PromptBuilder
func (*PromptBuilder) WithOptions ¶
func (b *PromptBuilder) WithOptions(optionFunc ValueGetter) *PromptBuilder
func (*PromptBuilder) WithValidator ¶
func (b *PromptBuilder) WithValidator(f ValidatorFunc) *PromptBuilder
type PromptsContext ¶
type PromptsContext struct {
// contains filtered or unexported fields
}
func NewPromptsContext ¶
func NewPromptsContext() *PromptsContext
NewPromptsContext creates a new PromptsContext
func (*PromptsContext) Set ¶
func (c *PromptsContext) Set(key string, value string)
Set sets the value of the given key
type ValueGetter ¶
func ListBasicValues ¶ added in v0.1.26
func ListBasicValues(vals []string) ValueGetter
func YesNo ¶
func YesNo() ValueGetter
Click to show internal directories.
Click to hide internal directories.