Documentation
¶
Index ¶
- func AllowAllStringValidator(_ string) error
- func GetInputFromPrompt(desiredInput string) string
- func GetVariableDefaultValue(draftConfig *config.DraftConfig, variable *config.BuilderVar) string
- func NoBlankStringValidator(s string) error
- func RunBoolPrompt(customPrompt *config.BuilderVar, Stdin io.ReadCloser, Stdout io.WriteCloser) (string, error)
- func RunDefaultableStringPrompt(defaultValue string, customPrompt *config.BuilderVar, ...) (string, error)
- func RunPromptsFromConfig(draftConfig *config.DraftConfig) error
- func RunPromptsFromConfigWithSkips(draftConfig *config.DraftConfig) error
- func RunPromptsFromConfigWithSkipsIO(draftConfig *config.DraftConfig, Stdin io.ReadCloser, Stdout io.WriteCloser) error
- func Select[T any](label string, items []T, opt *SelectOpt[T]) (T, error)
- type SelectOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowAllStringValidator ¶
AllowAllStringValidator is a string validator that allows any string
func GetInputFromPrompt ¶
func GetVariableDefaultValue ¶
func GetVariableDefaultValue(draftConfig *config.DraftConfig, variable *config.BuilderVar) string
GetVariableDefaultValue returns the default value for a variable, if one is set in variableDefaults from a ReferenceVar or literal Variable.DefaultValue in that order.
func NoBlankStringValidator ¶
NoBlankStringValidator is a string validator that does not allow blank strings
func RunBoolPrompt ¶
func RunBoolPrompt(customPrompt *config.BuilderVar, Stdin io.ReadCloser, Stdout io.WriteCloser) (string, error)
func RunDefaultableStringPrompt ¶
func RunDefaultableStringPrompt(defaultValue string, customPrompt *config.BuilderVar, validate func(string) error, Stdin io.ReadCloser, Stdout io.WriteCloser) (string, error)
RunDefaultableStringPrompt runs a prompt for a string variable, returning the user string input for the prompt
func RunPromptsFromConfig ¶
func RunPromptsFromConfig(draftConfig *config.DraftConfig) error
func RunPromptsFromConfigWithSkips ¶
func RunPromptsFromConfigWithSkips(draftConfig *config.DraftConfig) error
func RunPromptsFromConfigWithSkipsIO ¶
func RunPromptsFromConfigWithSkipsIO(draftConfig *config.DraftConfig, Stdin io.ReadCloser, Stdout io.WriteCloser) error
RunPromptsFromConfigWithSkipsIO runs the prompts for the given draftConfig skipping any variables in varsToSkip or where the BuilderVar.IsPromptDisabled is true. If Stdin or Stdout are nil, the default values will be used.