Documentation ¶
Index ¶
- Variables
- func AdvisoryColor(message string) string
- func Colorize(message string, textColor color.Attribute) string
- func ColorizeBold(message string, textColor color.Attribute) string
- func CommandColor(message string) string
- func CrashedColor(message string) string
- func Decolorize(message string) string
- func EntityNameColor(message string) string
- func FailureColor(message string) string
- func HeaderColor(message string) string
- func InitColorSupport()
- func LogAppHeaderColor(message string) string
- func LogHealthHeaderColor(message string) string
- func LogStderrColor(message string) string
- func LogStdoutColor(message string) string
- func LogSysHeaderColor(message string) string
- func NotLoggedInText() string
- func PromptColor(message string) string
- func StoppedColor(message string) string
- func SuccessColor(message string) string
- func TableContentHeaderColor(message string) string
- func WarningColor(message string) string
- type ColoringFunction
- type Printer
- type Table
- type TeePrinter
- func (t *TeePrinter) DisableTerminalOutput(disable bool)
- func (t *TeePrinter) Print(values ...interface{}) (int, error)
- func (t *TeePrinter) Printf(format string, a ...interface{}) (int, error)
- func (t *TeePrinter) Println(values ...interface{}) (int, error)
- func (t *TeePrinter) SetOutputBucket(bucket io.Writer)
- type Transformer
- type UI
- type UITable
Constants ¶
This section is empty.
Variables ¶
var ( TerminalSupportsColors = isTerminal() UserAskedForColors = "" )
Functions ¶
func AdvisoryColor ¶
func CommandColor ¶
func CrashedColor ¶
func Decolorize ¶
func EntityNameColor ¶
func FailureColor ¶
func HeaderColor ¶
func InitColorSupport ¶
func InitColorSupport()
func LogAppHeaderColor ¶
func LogHealthHeaderColor ¶
func LogStderrColor ¶
func LogStdoutColor ¶
func LogSysHeaderColor ¶
func NotLoggedInText ¶
func NotLoggedInText() string
func PromptColor ¶
func StoppedColor ¶
func SuccessColor ¶
func TableContentHeaderColor ¶
func WarningColor ¶
Types ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
PrintableTable is an implementation of the Table interface. It remembers the headers, the added rows, the column widths, and a number of other things.
func NewTable ¶
NewTable is the constructor function creating a new printable table from a list of headers. The table is also connected to a UI, which is where it will print itself to on demand.
func (*Table) NoHeaders ¶
func (t *Table) NoHeaders()
NoHeaders disables the printing of the header row for the specified table.
func (*Table) PrintTo ¶
PrintTo is the core functionality for printing the table, placing the formatted table into the writer given to it as argument. The exported Print() is just a wrapper around this which redirects the result into CF data structures. Once a table has been printed onto a Writer, it cannot be printed again.
func (*Table) SetTransformer ¶
func (t *Table) SetTransformer(columnIndex int, tr Transformer)
SetTransformer specifies a string transformer to apply to the content of the given column in the specified table.
type TeePrinter ¶
type TeePrinter struct {
// contains filtered or unexported fields
}
func NewTeePrinter ¶
func NewTeePrinter(w io.Writer) *TeePrinter
func (*TeePrinter) DisableTerminalOutput ¶
func (t *TeePrinter) DisableTerminalOutput(disable bool)
func (*TeePrinter) Print ¶
func (t *TeePrinter) Print(values ...interface{}) (int, error)
func (*TeePrinter) Printf ¶
func (t *TeePrinter) Printf(format string, a ...interface{}) (int, error)
func (*TeePrinter) Println ¶
func (t *TeePrinter) Println(values ...interface{}) (int, error)
func (*TeePrinter) SetOutputBucket ¶
func (t *TeePrinter) SetOutputBucket(bucket io.Writer)
type Transformer ¶
Transformer is the type of functions used to modify the content of a table cell for actual display. For multi-line content of a cell the transformation is applied to each individual line.
type UI ¶
type UI interface { PrintPaginator(rows []string, err error) Say(message string, args ...interface{}) // ProgressReader PrintCapturingNoOutput(message string, args ...interface{}) Warn(message string, args ...interface{}) Ask(prompt string) (answer string) AskForPassword(prompt string) (answer string) Confirm(message string) bool ConfirmDelete(modelType, modelName string) bool ConfirmDeleteWithAssociations(modelType, modelName string) bool Ok() Failed(message string, args ...interface{}) ShowConfiguration(coreconfig.Reader) error LoadingIndication() Table(headers []string) *UITable NotifyUpdateIfNeeded(coreconfig.Reader) Writer() io.Writer }