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 ¶ added in v0.0.28
AllowAllStringValidator is a string validator that allows any string
func GetInputFromPrompt ¶
func GetVariableDefaultValue ¶ added in v0.0.28
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 ¶ added in v0.0.28
NoBlankStringValidator is a string validator that does not allow blank strings
func RunBoolPrompt ¶ added in v0.0.28
func RunBoolPrompt(customPrompt *config.BuilderVar, Stdin io.ReadCloser, Stdout io.WriteCloser) (string, error)
func RunDefaultableStringPrompt ¶ added in v0.0.28
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 ¶ added in v0.0.24
func RunPromptsFromConfigWithSkips(draftConfig *config.DraftConfig) error
func RunPromptsFromConfigWithSkipsIO ¶ added in v0.0.28
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.