Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidPromptType ¶
IsValidPromptType checks that the given promptType is valid.
Types ¶
type Answer ¶
type Answer struct {
// contains filtered or unexported fields
}
Answers holds the Prompt Answer configuration.
func (*Answer) WriteAnswer ¶
WriteAnswer writes the answers to the global AnswerMap var.
type Question ¶
type Question struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Options QuestionOptions `yaml:"prompt"`
Validate QuestionValidation `yaml:"validate"`
}
Question holds the Survey question configs.
func (Question) AsSurveyQuestion ¶
AsSurveyQuestion coerces the question into a survey.Question type.
func (Question) Transformer ¶
func (question Question) Transformer() survey.Transformer
Transformer returns the survey.Transformer for the specific Question.
type QuestionOptions ¶
type QuestionOptions struct {
Message string `yaml:"message"`
Default string `yaml:"default"`
Help string `yaml:"help"`
Options []string `yaml:"options"`
PageSize int `yaml:"pageSize"`
VimMode bool `yaml:"vimMode"`
Editor string `yaml:"editor"`
HideDefault bool `yaml:"hideDefault"`
AppendDefault bool `yaml:"appendDefault"`
FileName string `yaml:"fileName"`
}
QuestionOptions provides option storage for Survey Question instances.
type QuestionValidation ¶
type QuestionValidation struct {
Required bool `yaml:"required"`
MinLength int `yaml:"minLength"`
MaxLength int `yaml:"maxLength"`
}
QuestionValidation provides validation options for Survey Question instances.
Click to show internal directories.
Click to hide internal directories.