Documentation ¶
Index ¶
- Variables
- type ConfirmOption
- type GetOption
- type Prompt
- func (p Prompt) Confirm(message, help string, opts ...ConfirmOption) (bool, error)
- func (p Prompt) Get(message, help string, validator ValidatorFunc, opts ...GetOption) (string, error)
- func (p Prompt) GetSecret(message, help string) (string, error)
- func (p Prompt) SelectOne(message, help string, options []string) (string, error)
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyOptions = errors.New("list of provided options is empty")
ErrEmptyOptions indicates the input options list was empty.
Functions ¶
This section is empty.
Types ¶
type ConfirmOption ¶
type ConfirmOption func(*survey.Confirm)
func WithTrueDefault ¶
func WithTrueDefault() ConfirmOption
type GetOption ¶
type GetOption func(*survey.Input)
GetOption is a functional option to modify the Get prompt.
func WithDefaultInput ¶
WithDefaultInput sets a default message for the input.
type Prompt ¶
type Prompt func(survey.Prompt, interface{}, ...survey.AskOpt) error
Prompt abstracts the survey.Askone function.
func (Prompt) Confirm ¶
func (p Prompt) Confirm(message, help string, opts ...ConfirmOption) (bool, error)
Confirm prompts the user with a yes/no option.
func (Prompt) Get ¶
func (p Prompt) Get(message, help string, validator ValidatorFunc, opts ...GetOption) (string, error)
Get prompts the user for free-form text input.
type ValidatorFunc ¶
type ValidatorFunc func(interface{}) error
ValidatorFunc defines the function signature for validating inputs.
Click to show internal directories.
Click to hide internal directories.