Documentation ¶
Overview ¶
simple ui - TODO use something more sophisticated :)
Index ¶
- Constants
- Variables
- func Alert(message string, subMessages ...string)
- func CommandOutput(output []byte, command string, params ...string)
- func Completed(message string, subMessages ...string)
- func Confirm(message string) bool
- 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 H1(message string)
- func H2(message string)
- func Info(message string, subMessages ...string)
- func InfoGrid(table map[string]string)
- func IsVerbose() bool
- func JSONTable(tableData TableData, writer io.Writer) error
- func Link(message string, subMessages ...string)
- func LogLine(message string)
- func Logo()
- func LogoNoColor()
- func Medal()
- func NL(amount ...int)
- func NewSpinner(t string) *pterm.SpinnerPrinter
- func Paragraph(message string)
- func Print(message string, subMessages ...string)
- func PrintArrayTable(a [][]string)
- func PrintConfigApiError(err error)
- func PrintConfigError(err error)
- func PrintDisabled(message string, subMessages ...string)
- func PrintDot()
- func PrintEnabled(message string, subMessages ...string)
- func PrintOnError(item string, errors ...error)
- func Printf(format string, data ...any)
- func Properties(table [][]string)
- func Select(title string, options []string) string
- 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 TextInput(message string) string
- 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) Alert(message string, subMessages ...string)
- func (ui *UI) CommandOutput(output []byte, command string, params ...string)
- func (ui *UI) Completed(main string, sub ...string)
- func (ui *UI) Confirm(label string) bool
- 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) H1(text string)
- func (ui *UI) H2(text 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) Link(message string, subMessages ...string)
- func (ui *UI) LogLine(message string)
- func (ui *UI) Logo()
- func (ui *UI) LogoNoColor()
- func (ui *UI) Medal()
- func (ui *UI) NL(amount ...int)
- func (ui *UI) NewArrayTable(a [][]string) ArrayTable
- func (ui *UI) Paragraph(text string)
- func (ui *UI) Print(message string, subMessages ...string)
- func (ui *UI) PrintArrayTable(a [][]string)
- func (ui *UI) PrintDisabled(message string, subMessages ...string)
- func (ui *UI) PrintDot()
- 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) Properties(table [][]string)
- func (ui *UI) Select(label string, options []string) string
- 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) TextInput(text string) string
- func (ui *UI) Vector(table []string)
- func (ui *UI) Warn(message string, subMessages ...string)
- func (ui *UI) WarnOnError(item string, errors ...error)
Constants ¶
const CloudIcon = "☁️"
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 IconWarning = "🚨"
IconWarning emoji
const IconWorld = "🌍"
IconWorld emoji
const (
Separator = "separator"
)
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 Default = color.FgDefault.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 NewSpinner ¶ added in v1.11.25
func NewSpinner(t string) *pterm.SpinnerPrinter
func PrintArrayTable ¶ added in v1.11.25
func PrintArrayTable(a [][]string)
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 Properties ¶ added in v1.11.25
func Properties(table [][]string)
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) PrintArrayTable ¶ added in v1.11.25
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) Properties ¶ added in v1.11.25
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