Documentation
¶
Index ¶
- Variables
- func BeginLoading(format string, a ...any)
- func BeginProgressBar(format string, a ...any)
- func CancelLoading()
- func CancelProgressBar()
- func Error(format string, a ...any) error
- func FinishLoading()
- func FinishProgressBar()
- func Input(prompt string, validators ...Validator) (string, error)
- func Print(format string, a ...any)
- func PrintColor(color Color, format string, a ...any)
- func Select(msg string, options []string) (int, error)
- func SelectString(msg string, displayOptions []string, options []string) (string, error)
- func Success(format string, a ...any)
- func UpdateProgressBar(progress float64)
- func Warn(format string, a ...any)
- func YesNo(question string, defaultValue bool) (yes bool, err error)
- type Color
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCanceled indicates that the user has interrupted the programm, e.g. by using Ctrl + C. ErrCanceled = errors.New("Canceled.") )
Functions ¶
func BeginLoading ¶
func BeginProgressBar ¶
func CancelLoading ¶
func CancelLoading()
func CancelProgressBar ¶
func CancelProgressBar()
func FinishLoading ¶
func FinishLoading()
func FinishProgressBar ¶
func FinishProgressBar()
func PrintColor ¶
func Select ¶
Select asks the user to select on of many options. It returns the index of the chosen option.
func SelectString ¶
SelectString asks the user to select on of many options. It returns the entry in options with the chosen index. It panics if the length of displayOptions differs from the length of options.
func UpdateProgressBar ¶
func UpdateProgressBar(progress float64)
Types ¶
type Color ¶
type Color string
const ( Reset Color = "\x1b[0m" Black Color = "\x1b[30m" Red Color = "\x1b[31m" Green Color = "\x1b[32m" Yellow Color = "\x1b[33m" Blue Color = "\x1b[34m" Magenta Color = "\x1b[35m" Cyan Color = "\x1b[36m" White Color = "\x1b[37m" BlackBold Color = "\x1b[1;30m" RedBold Color = "\x1b[1;31m" GreenBold Color = "\x1b[1;32m" YellowBold Color = "\x1b[1;33m" BlueBold Color = "\x1b[1;34m" MagentaBold Color = "\x1b[1;35m" CyanBold Color = "\x1b[1;36m" WhiteBold Color = "\x1b[1;37m" )
Click to show internal directories.
Click to hide internal directories.