Documentation ¶
Overview ¶
simple ui - TODO use something more sophisticated :)
Index ¶
- Constants
- Variables
- func CommandOutput(output []byte, command string, params ...string)
- func Completed(message string, subMessages ...string)
- func Debug(message string, subMessages ...string)
- func Err(err error)
- func Errf(err string, params ...interface{})
- func ExitOnError(item string, errors ...error)
- func Fail(err error)
- func Failf(err string, params ...interface{})
- func GroupCompleted(main string, sub ...string)
- func Info(message string, subMessages ...string)
- func InfoGrid(table map[string]string)
- func JSONTable(tableData TableData, writer io.Writer) error
- func LogLine(message string)
- func Logo()
- func LogoNoColor()
- func Medal()
- func NL()
- func PrintOnError(item string, errors ...error)
- func SetVerbose(verbose bool)
- func ShellCommand(title string, commands ...string)
- func Success(message string, subMessages ...string)
- func SuccessAndExit(message string, subMessages ...string)
- func Table(tableData TableData, writer io.Writer)
- func UseStderr()
- func UseStdout()
- func Vector(table []string)
- func Warn(message string, subMessages ...string)
- func WarnOnError(item string, errors ...error)
- type ArrayTable
- type TableData
- type UI
- func (ui *UI) CommandOutput(output []byte, command string, params ...string)
- func (ui *UI) Completed(main string, sub ...string)
- func (ui *UI) Debug(message string, subMessages ...string)
- func (ui *UI) Err(err error)
- func (ui *UI) Errf(err string, params ...interface{})
- func (ui *UI) ExitOnError(item string, errors ...error)
- func (ui *UI) Fail(err error)
- func (ui *UI) Failf(err string, params ...interface{})
- func (ui *UI) GroupCompleted(main string, sub ...string)
- func (ui *UI) Info(message string, subMessages ...string)
- func (ui *UI) InfoGrid(table map[string]string)
- func (ui *UI) JSONTable(tableData TableData, writer io.Writer) error
- func (ui *UI) LogLine(message string)
- func (ui *UI) Logo()
- func (ui *UI) LogoNoColor()
- func (ui *UI) Medal()
- func (ui *UI) NL()
- func (ui *UI) NewArrayTable(a [][]string) ArrayTable
- func (ui *UI) PrintOnError(item string, errors ...error)
- func (ui *UI) ShellCommand(title string, commands ...string)
- func (ui *UI) Success(message string, subMessages ...string)
- func (ui *UI) SuccessAndExit(message string, subMessages ...string)
- func (ui *UI) Table(tableData TableData, writer io.Writer)
- func (ui *UI) Vector(table []string)
- func (ui *UI) Warn(message string, subMessages ...string)
- func (ui *UI) WarnOnError(item string, errors ...error)
Constants ¶
View Source
const IconError = "💔"
IconError emoji
View Source
const IconMedal = "🥇"
IconMedal emoji
Variables ¶
View Source
var ( White = color.FgWhite.Render Blue = color.FgBlue.Render Green = color.FgGreen.Render Yellow = color.FgYellow.Render Red = color.FgRed.Render LightYellow = color.FgLightYellow.Render LightCyan = color.FgLightCyan.Render LightGray = color.FgGray.Render LightRed = color.FgLightRed.Render LightBlue = color.FgLightBlue.Render DarkGray = color.FgDarkGray.Render )
View Source
var Verbose = false
Verbose adds additional info messages e.g. in case of checking errors
View Source
var Writer io.Writer = os.Stdout
Functions ¶
func CommandOutput ¶
func ExitOnError ¶
func GroupCompleted ¶
func LogoNoColor ¶
func LogoNoColor()
func PrintOnError ¶
func SetVerbose ¶
func SetVerbose(verbose bool)
func ShellCommand ¶
func SuccessAndExit ¶
func WarnOnError ¶
Types ¶
type ArrayTable ¶
type ArrayTable [][]string
func NewArrayTable ¶
func NewArrayTable(a [][]string) ArrayTable
func (ArrayTable) Table ¶
func (a ArrayTable) Table() (header []string, data [][]string)
type UI ¶
func NewStderrUI ¶
func NewStdoutUI ¶
func (*UI) CommandOutput ¶
func (*UI) ExitOnError ¶
func (*UI) GroupCompleted ¶
func (*UI) LogoNoColor ¶
func (ui *UI) LogoNoColor()
func (*UI) NewArrayTable ¶
func (ui *UI) NewArrayTable(a [][]string) ArrayTable
func (*UI) PrintOnError ¶
func (*UI) ShellCommand ¶
Warn shows warning in terminal
func (*UI) SuccessAndExit ¶
SuccessAndExit shows success in terminal and exit
func (*UI) WarnOnError ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.