Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToSelect ¶
func ToSelect(options InputOptions) (int, error)
ToSelect prompts the user to select an option from the provided `options.Options` argument. On success, returns the selected index. Returns `ErrorSkipped` if the user indicated to skip, returns `ErrorInput` on input validation errors, returns `ErrorSystem` on system errors
Types ¶
type InputError ¶ added in v0.1.18
type InputError int
const ( ErrorSkipped InputError = -1 ErrorInput InputError = -2 ErrorSystem InputError = -3 )
type InputHelper ¶ added in v0.1.18
type InputHelper InputOptions
InputHelper implements helper functions over the InputOptions structure
func (InputHelper) GetData ¶ added in v0.1.18
func (ih InputHelper) GetData() string
GetData retrieves the read input
func (InputHelper) PrintAfterMessage ¶ added in v0.1.18
func (ih InputHelper) PrintAfterMessage()
PrintAfterMessage prints the message to be displayed after the possible options have been printed
func (InputHelper) PrintBeforeMessage ¶ added in v0.1.18
func (ih InputHelper) PrintBeforeMessage()
PrintBeforeMessage prints the message to be displayed before the possible options are printed
func (InputHelper) PrintOptions ¶ added in v0.1.18
func (ih InputHelper) PrintOptions()
PrintOptions prints the possible options for the user to select
func (*InputHelper) ReadInput ¶ added in v0.1.18
func (ih *InputHelper) ReadInput() error
ReadInput reads in a user's input