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 Print(message string, subMessages ...string)
- func PrintConfigApiError(err error)
- func PrintConfigError(err error)
- func PrintDisabled(message string, subMessages ...string)
- func PrintEnabled(message string, subMessages ...string)
- func PrintOnError(item string, errors ...error)
- func Printf(format string, data ...any)
- 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) Print(message string, subMessages ...string)
- func (ui *UI) PrintDisabled(message string, subMessages ...string)
- func (ui *UI) PrintEnabled(message string, subMessages ...string)
- func (ui *UI) PrintOnError(item string, errors ...error)
- func (ui *UI) Printf(format string, data ...any)
- 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 ¶
const IconBox = "📦"
IconBox emoji
const IconCabinet = "🗄️"
IconCabinet emoji
const IconCheckMark = "✅"
IconCheckMark emoji
const IconCross = "❌"
IconCross emoji
const IconDocumentation = "📖"
IconDocumentation emoji
const IconError = "💔"
IconError emoji
const IconFile = "📂"
IconFile emoji
const IconKey = "🔑"
IconKey emoji
const IconMedal = "🥇"
IconMedal emoji
const IconMicroscope = "🔬"
IconMicroscope emoji
const IconRocket = "🚀"
IconRocket emoji
const IconSuggestion = "💡"
IconSuggestion emoji
const IconTruck = "🚚"
IconTruck emoji
const IconUnlocked = "🔓"
IconUnlocked emoji
const IconWorld = "🌍"
IconWorld emoji
Variables ¶
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 LightMagenta = color.FgLightMagenta.Render DarkGray = color.FgDarkGray.Render )
var Verbose = false
Verbose adds additional info messages e.g. in case of checking errors
var Writer io.Writer = os.Stdout
Functions ¶
func CommandOutput ¶
func ExitOnError ¶
func GroupCompleted ¶
func LogoNoColor ¶
func LogoNoColor()
func PrintConfigApiError ¶ added in v1.5.15
func PrintConfigApiError(err error)
PrintConfigApiError prints error message suggestion and documentation link
func PrintConfigError ¶ added in v1.5.6
func PrintConfigError(err error)
PrintConfigError prints error message suggestion and documentation link
func PrintDisabled ¶ added in v1.5.6
func PrintEnabled ¶ added in v1.5.6
func PrintOnError ¶
func SetVerbose ¶ added in v1.0.16
func SetVerbose(verbose bool)
func ShellCommand ¶
func SuccessAndExit ¶ added in v1.0.23
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 ¶ added in v0.8.4
func NewStderrUI ¶ added in v1.2.15
func NewStdoutUI ¶ added in v0.8.4
func (*UI) CommandOutput ¶ added in v0.8.4
func (*UI) ExitOnError ¶ added in v0.8.4
func (*UI) GroupCompleted ¶ added in v0.8.4
func (*UI) LogoNoColor ¶ added in v0.8.4
func (ui *UI) LogoNoColor()
func (*UI) NewArrayTable ¶ added in v0.8.4
func (ui *UI) NewArrayTable(a [][]string) ArrayTable
func (*UI) PrintDisabled ¶ added in v1.5.6
PrintDisabled shows insuccess in terminal
func (*UI) PrintEnabled ¶ added in v1.5.6
PrintEnabled shows enabled in terminal
func (*UI) PrintOnError ¶ added in v0.8.4
func (*UI) ShellCommand ¶ added in v0.8.4
Warn shows warning in terminal
func (*UI) SuccessAndExit ¶ added in v1.0.23
SuccessAndExit shows success in terminal and exit