ui

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2019 License: MIT Imports: 14 Imported by: 7

Documentation

Overview

Package ui helps get user input from the terminal, and formats output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

func Accept(question string) bool

Accept asks a question and returns the answer

func Blue

func Blue(in string) string

Blue outputs a string in blue.

func BlueBold

func BlueBold(in string) string

BlueBold outputs a string in blue bold.

func BlueUnderlined added in v0.10.0

func BlueUnderlined(in string) string

BlueUnderlined outputs a string in blue, underlined.

func GetInput

func GetInput(in *os.File) (string, error)

GetInput from user

func Green

func Green(in string) string

Green outputs a string in green.

func GreenBold

func GreenBold(in string) string

GreenBold outputs a string in green bold.

func GreenUnderlined added in v0.10.0

func GreenUnderlined(in string) string

GreenUnderlined outputs a string in green, underlined.

func Red

func Red(in string) string

Red outputs a string in red.

func RedBold

func RedBold(in string) string

RedBold outputs a string in red bold.

func RedUnderlined added in v0.10.0

func RedUnderlined(in string) string

RedUnderlined outputs a string in red, underlined.

func RemoveColor added in v0.7.1

func RemoveColor(str string) string

func SelectOption

func SelectOption(title, usage string, options []string) (string, error)

SelectOption among several, or input a new one, and return user input.

func SpinWhileThingsHappen

func SpinWhileThingsHappen(title string, f func() error) error

SpinWhileThingsHappen is a way to launch a function and display a spinner while it is being executed.

func TabulateMap added in v0.9.0

func TabulateMap(input map[string]int, firstHeader string, secondHeader string) (table string)

TabulateMap of map[string]int.

func TabulateRows added in v0.9.0

func TabulateRows(rows [][]string, headers ...string) (table string)

TabulateRows of map[string]int.

func UserChoice

func UserChoice(msg string, args ...interface{})

UserChoice message logging

func Warning added in v0.9.0

func Warning(in string) string

Warning output.

func Yellow

func Yellow(in string) string

Yellow outputs a string in yellow.

func YellowUnderlined

func YellowUnderlined(in string) string

YellowUnderlined outputs a string in yellow, underlined.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL