Documentation ¶
Overview ¶
Package ui contains some common UI elements, that use Survey library.
Index ¶
- Variables
- func Confirm(msg string, _ bool, opt ...Option) (bool, error)
- func FileSelector(msg, descr string, opt ...Option) (string, error)
- func Input(msg, help string, validateFn func(s string) error) (string, error)
- func NoValidation(s string) error
- func String(msg, help string) (string, error)
- func StringRequire(msg, help string) (string, error)
- func Time(msg string, _ ...Option) (time.Time, error)
- func ValidateNotEmpty(s string) error
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyOptionalInput = errors.New("empty input in optional field")
ErrEmptyOptionalInput is returned when an optional input is empty.
Functions ¶
func NoValidation ¶
func StringRequire ¶
StringRequire requires user to input string.
func Time ¶
Time asks the user to enter a date and time. For simplicity, the date and time are entered in two separate prompts. The date is optional, and if it is not given, the function terminates returning ErrEmptyOptionalInput. If the date is entered and is valid (checked with validators, you don't have to worry), the function will ask for time, which is then required.
func ValidateNotEmpty ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.