Documentation
¶
Index ¶
- Variables
- type Prompt
- func (p *Prompt) Ask(ctx context.Context, prompt string) (string, error)
- func (p *Prompt) Confirm(ctx context.Context, prompt string) (bool, error)
- func (p *Prompt) Default(defaultTo string) *Question
- func (p *Prompt) Is(validators ...func(string) error) *Question
- func (p *Prompt) Optional(optional bool) *Question
- func (p *Prompt) Password(ctx context.Context, prompt string) (string, error)
- type Question
- func (q *Question) Ask(ctx context.Context, prompt string) (string, error)
- func (q *Question) Confirm(ctx context.Context, prompt string) (bool, error)
- func (q *Question) Default(defaultTo string) *Question
- func (q *Question) Is(validators ...func(string) error) *Question
- func (q *Question) Optional(optional bool) *Question
- func (q *Question) Password(ctx context.Context, prompt string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRequired = fmt.Errorf("prompter: input is required")
ErrRequired is returned when a required input is empty
Functions ¶
This section is empty.
Types ¶
type Prompt ¶ added in v0.0.2
type Prompt struct {
// contains filtered or unexported fields
}
Prompt can ask for inputs and validate them
type Question ¶
type Question struct {
// contains filtered or unexported fields
}
Question that can be asked
Click to show internal directories.
Click to hide internal directories.