Documentation ¶
Index ¶
- Variables
- func Bold(msg interface{}) string
- func BoldBlack(msg interface{}) string
- func BoldBlue(msg interface{}) string
- func BoldGreen(msg interface{}) string
- func BoldRed(msg interface{}) string
- func BoldYellow(msg interface{}) string
- func Emoji(emoji string) string
- func GetMilliseconds(timestamp time.Time) int64
- func GetMillisecondsIfExists(timestamp *time.Time) *int64
- func Red(msg interface{}) string
- type Format
- type Printer
- func (p *Printer) ConfirmCommand(confirmationName, commandShortName, confirmFailedName string) error
- func (p *Printer) Format() Format
- func (p *Printer) Out() io.Writer
- func (p *Printer) PrettyPrintJSON(b []byte) error
- func (p *Printer) Print(i ...interface{})
- func (p *Printer) PrintJSON(v interface{}) error
- func (p *Printer) PrintProgress(message string) func()
- func (p *Printer) PrintResource(v interface{}) error
- func (p *Printer) Printf(format string, i ...interface{})
- func (p *Printer) Println(i ...interface{})
- func (p *Printer) SetHumanOutput(out io.Writer)
- func (p *Printer) SetResourceOutput(out io.Writer)
Constants ¶
This section is empty.
Variables ¶
var IsTTY = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
Functions ¶
func BoldBlack ¶
func BoldBlack(msg interface{}) string
BoldBlack returns a string formatted with Black and bold.
func BoldBlue ¶
func BoldBlue(msg interface{}) string
BoldBlue returns a string formatted with blue and bold.
func BoldGreen ¶
func BoldGreen(msg interface{}) string
BoldGreen returns a string formatted with green and bold.
func BoldRed ¶
func BoldRed(msg interface{}) string
BoldRed returns a string formatted with red and bold.
func BoldYellow ¶
func BoldYellow(msg interface{}) string
BoldYellow returns a string formatted with yellow and bold.
func GetMilliseconds ¶
func GetMillisecondsIfExists ¶
Types ¶
type Format ¶
type Format int
Format defines the option output format of a resource.
func NewFormatValue ¶
NewFormatValue is used to define a flag that can be used to define a custom flag via the flagset.Var() method.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer is used to print information to the defined output.
func NewPrinter ¶
NewPrinter returns a new Printer for the given output and format.
func (*Printer) ConfirmCommand ¶
func (*Printer) Out ¶
Out defines the output to write human-readable text. If format is not set to human, Out returns io.Discard, which means that any output will be discarded
func (*Printer) PrettyPrintJSON ¶
func (*Printer) Print ¶
func (p *Printer) Print(i ...interface{})
Print is a convenience method to Print to the defined output.
func (*Printer) PrintProgress ¶
PrintProgress starts a spinner with the relevant message. The returned function needs to be called in a defer or when it's decided to stop the spinner
func (*Printer) PrintResource ¶
PrintResource prints the given resource in the format it was specified.
func (*Printer) Println ¶
func (p *Printer) Println(i ...interface{})
Println is a convenience method to Println to the defined output.
func (*Printer) SetHumanOutput ¶
SetHumanOutput sets the output for human readable messages.
func (*Printer) SetResourceOutput ¶
SetResourceOutput sets the output for printing resources via PrintResource.