terminal

package
v6.12.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 17 Imported by: 1,326

Documentation

Index

Constants

View Source
const QuietPanic = "This shouldn't print anything"

Variables

View Source
var (
	OsSupportsColors       = runtime.GOOS != "windows"
	TerminalSupportsColors = isTerminal()
	UserAskedForColors     = ""
)

Functions

func AdvisoryColor

func AdvisoryColor(message string) string

func Colorize

func Colorize(message string, color Color) string

func ColorizeBold

func ColorizeBold(message string, color Color) string

func CommandColor

func CommandColor(message string) string

func CrashedColor

func CrashedColor(message string) string

func Decolorize

func Decolorize(message string) string

func EntityNameColor

func EntityNameColor(message string) string

func FailureColor

func FailureColor(message string) string

func HeaderColor

func HeaderColor(message string) string

func InitColorSupport

func InitColorSupport()

func LogAppHeaderColor

func LogAppHeaderColor(message string) string

func LogHealthHeaderColor

func LogHealthHeaderColor(message string) string

func LogStderrColor

func LogStderrColor(message string) string

func LogStdoutColor

func LogStdoutColor(message string) string

func LogSysHeaderColor

func LogSysHeaderColor(message string) string

func NotLoggedInText

func NotLoggedInText() string

func PromptColor

func PromptColor(message string) string

func StoppedColor

func StoppedColor(message string) string

func SuccessColor

func SuccessColor(message string) string

func TableContentHeaderColor

func TableContentHeaderColor(message string) string

func WarningColor

func WarningColor(message string) string

Types

type Color

type Color uint

type ColoringFunction

type ColoringFunction func(value string, row int, col int) string

type DebugPrinter

type DebugPrinter struct{}

func (DebugPrinter) Print

func (DebugPrinter) Print(title, dump string)

type OutputCapture

type OutputCapture interface {
	SetOutputBucket(*[]string)
}

type PrintableTable

type PrintableTable struct {
	// contains filtered or unexported fields
}

func (*PrintableTable) Add

func (t *PrintableTable) Add(row ...string)

func (*PrintableTable) Print

func (t *PrintableTable) Print()

type Printer

type Printer interface {
	Print(a ...interface{}) (n int, err error)
	Printf(format string, a ...interface{}) (n int, err error)
	Println(a ...interface{}) (n int, err error)
	ForcePrint(a ...interface{}) (n int, err error)
	ForcePrintf(format string, a ...interface{}) (n int, err error)
	ForcePrintln(a ...interface{}) (n int, err error)
}

type Table

type Table interface {
	Add(row ...string)
	Print()
}

func NewTable

func NewTable(ui UI, headers []string) Table

type TeePrinter

type TeePrinter struct {
	// contains filtered or unexported fields
}

func NewTeePrinter

func NewTeePrinter() *TeePrinter

func (*TeePrinter) DisableTerminalOutput

func (t *TeePrinter) DisableTerminalOutput(disable bool)

func (*TeePrinter) ForcePrint

func (t *TeePrinter) ForcePrint(values ...interface{}) (n int, err error)

func (*TeePrinter) ForcePrintf

func (t *TeePrinter) ForcePrintf(format string, a ...interface{}) (n int, err error)

func (*TeePrinter) ForcePrintln

func (t *TeePrinter) ForcePrintln(values ...interface{}) (n int, err error)

func (*TeePrinter) Print

func (t *TeePrinter) Print(values ...interface{}) (n int, err error)

func (*TeePrinter) Printf

func (t *TeePrinter) Printf(format string, a ...interface{}) (n int, err error)

func (*TeePrinter) Println

func (t *TeePrinter) Println(values ...interface{}) (n int, err error)

func (*TeePrinter) SetOutputBucket

func (t *TeePrinter) SetOutputBucket(bucket *[]string)

type TerminalOutputSwitch

type TerminalOutputSwitch interface {
	DisableTerminalOutput(bool)
}

type UI

type UI interface {
	PrintPaginator(rows []string, err error)
	Say(message string, args ...interface{})
	PrintCapturingNoOutput(message string, args ...interface{})
	Warn(message string, args ...interface{})
	Ask(prompt string, args ...interface{}) (answer string)
	AskForPassword(prompt string, args ...interface{}) (answer string)
	Confirm(message string, args ...interface{}) bool
	ConfirmDelete(modelType, modelName string) bool
	ConfirmDeleteWithAssociations(modelType, modelName string) bool
	Ok()
	Failed(message string, args ...interface{})
	FailWithUsage(context *cli.Context)
	PanicQuietly()
	ShowConfiguration(core_config.Reader)
	LoadingIndication()
	Wait(duration time.Duration)
	Table(headers []string) Table
}

func NewUI

func NewUI(r io.Reader, printer Printer) UI

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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