Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileReader ¶ added in v0.44.0
FileReader represents the input of a terminal
type FileWriter ¶ added in v0.44.0
FileWriter represents the output of a terminal
type InputOption ¶
type InputOption func(*survey.Input)
InputOption represets a funcion the customizes a survey.Input object
func WithDefault ¶
func WithDefault(d string) InputOption
WithDefault will set a default answer to the question
func WithSuggestion ¶
func WithSuggestion(fn func(toComplete string) []string) InputOption
WithSuggestion applies the suggestion function to the input question
type UI ¶ added in v0.44.0
type UI interface { // SetPageSize changes how many entries are shown on AskFromOptions and // AskManyFromOptions at a time SetPageSize(p uint) UI // AskForText interactively ask for one string from the user AskForText(m string, opts ...InputOption) (string, error) // AskForValidText for a string interactively from the user and validates // it AskForValidText( m string, validate func(string) error, opts ...InputOption, ) (string, error) // AskForDateTime interactively ask for one date and time from the user AskForDateTime(m, d string, ct convertTime) (time.Time, error) // AskForDateTimeOrNil interactively ask for one date and time from the // user, but allows a empty response AskForDateTimeOrNil(m, d string, ct convertTime) (*time.Time, error) // AskForInt interactively ask for one int from the user AskForInt(m string, d int) (int, error) // AskFromOptions interactively ask the user to choose one option or none AskFromOptions(m string, o []string, d string) (string, error) // AskManyFromOptions interactively ask the user to choose none or many // option AskManyFromOptions( m string, o, d []string, validade func([]string) error, ) ([]string, error) // Confirm interactively ask the user a yes/no question Confirm(m string, d bool) (bool, error) }
UI provides functions to prompt information from a terminal
func NewUI ¶ added in v0.44.0
func NewUI(in FileReader, out FileWriter, err io.Writer) UI
NewUI creates a new UI instance
Click to show internal directories.
Click to hide internal directories.