ui

package
v0.7.16 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 7 Imported by: 30

Documentation

Overview

simple ui - TODO use something more sophisticated :)

Index

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

Functions

func CommandOutput

func CommandOutput(output []byte, command string, params ...string)

func Completed

func Completed(main string, sub ...string)

func Debug added in v0.7.3

func Debug(message string, subMessages ...string)

func Err

func Err(err error)

func Errf

func Errf(err string, params ...interface{})

func ExitOnError

func ExitOnError(item string, errors ...error)

func Fail

func Fail(err error)

func Failf

func Failf(err string, params ...interface{})

func GroupCompleted

func GroupCompleted(main string, sub ...string)

func Info

func Info(message string, subMessages ...string)

func InfoGrid

func InfoGrid(table map[string]string)

func JSONTable

func JSONTable(tableData TableData, writer io.Writer) error

func LogLine added in v0.6.5

func LogLine(message string)
func Logo()

func LogoNoColor

func LogoNoColor()

func Medal

func Medal()

func NL

func NL()

func PrintOnError

func PrintOnError(item string, errors ...error)

func ShellCommand

func ShellCommand(title string, commands ...string)

Warn shows warning in terminal

func Success

func Success(message string, subMessages ...string)

Warn shows warning in terminal

func Table

func Table(tableData TableData, writer io.Writer)

func Vector

func Vector(table []string)

func Warn

func Warn(message string, subMessages ...string)

Warn shows warning in terminal

func WarnOnError

func WarnOnError(item string, errors ...error)

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 TableData

type TableData interface {
	Table() (header []string, data [][]string)
}

Jump to

Keyboard shortcuts

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