Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ColorBlack Black text style ColorBlack = "30" // ColorRed red text style ColorRed = "31" // ColorGreen green text style ColorGreen = "32" // ColorYello yellow text style ColorYellow = "33" // ColorBlue blue text style ColorBlue = "34" // ColorMagenta magenta text style ColorMagenta = "35" // ColorCyan cyan text style ColorCyan = "36" // ColorWhite white text style ColorWhite = "37" // ColorGrey grey text style ColorGrey = "90" // ColorBlackBg black background style ColorBlackBg = "40" // ColorRedBg red background style ColorRedBg = "41" // ColorGreenBg green background style ColorGreenBg = "42" // ColorYellowBg yellow background style ColorYellowBg = "43" // ColorBlueBg blue background style ColorBlueBg = "44" // ColorMagentaBg magenta background style ColorMagentaBg = "45" // ColorCyanBg cyan background style ColorCyanBg = "46" // WhtBg white background style ColorWhiteBg = "47" // StyleReset reset emphasis style StyleReset = "0" // StyleBold bold emphasis style StyleBold = "1" // StyleDim dim emphasis style StyleDim = "2" // StyleItalic italic emphasis style StyleItalic = "3" // StyleUnderline underline emphasis style StyleUnderline = "4" // StyleInverse inverse emphasis style StyleInverse = "7" // StyleHidden hidden emphasis style StyleHidden = "8" // StyleStrikeout strikeout emphasis style StyleStrikeout = "9" )
Variables ¶
View Source
var DefaultUI = New()
DefaultUI is the default UI for the package
View Source
var TitleUnderliner = "="
TitleUnderliner is the underline character for the title
Functions ¶
Types ¶
type BufferedPrinter ¶
type BufferedPrinter struct { // Writer is where the output should writer to Writer io.Writer // contains filtered or unexported fields }
Printer represents the output printer for the ui
func NewPrinter ¶
func NewPrinter() *BufferedPrinter
NewPrinter returns a pointer to a new printer object
func Printer ¶
func Printer() *BufferedPrinter
Printer returns the object that prints from the Default UI
func (*BufferedPrinter) Add ¶
func (p *BufferedPrinter) Add(c fmt.Stringer) *BufferedPrinter
Add adds the components to the printer
func (*BufferedPrinter) Flush ¶
func (p *BufferedPrinter) Flush()
Print prints the output to the writer
func (*BufferedPrinter) String ¶
func (p *BufferedPrinter) String() string
String returns the formmated string of the output
type Title ¶
type Title struct {
// contains filtered or unexported fields
}
Title is a UI component that renders a title
type UI ¶
UI implements UserInterface and uses standard i/o
func (*UI) SetNoColor ¶
SetNoColor sets if the output should have color
func (*UI) SetNoInteractive ¶
SetNoInteractive sets the interactive mode for the UI
type UserInterface ¶
type UserInterface interface { // Printer must return the object that prints to the UI Printer() *BufferedPrinter // Prompter must return the object that prompts the user for input Prompt() *prompt.Prompter // Color returns an instance of color Color() *color.Color // SetNoInteractive must set the interactive mode for the UI SetNoInteractive(bool) // SetNoColor must set the color mode for output SetNoColor(nocolor bool) }
UserInterface is the interface that defines UI interation functionality to the CLI
Click to show internal directories.
Click to hide internal directories.