Documentation
¶
Index ¶
- type ColorScheme
- func (cs *ColorScheme) Bold(s string) string
- func (cs *ColorScheme) Cyan(s string) string
- func (cs *ColorScheme) FailureIcon() string
- func (cs *ColorScheme) Green(s string) string
- func (cs *ColorScheme) Magenta(s string) string
- func (cs *ColorScheme) Muted(s string) string
- func (cs *ColorScheme) Red(s string) string
- func (cs *ColorScheme) SuccessIcon() string
- func (cs *ColorScheme) SuccessIconWithColor(msg string) string
- func (cs *ColorScheme) WarningIcon() string
- func (cs *ColorScheme) Yellow(s string) string
- type IOStreams
- func (s *IOStreams) ColorEnabled() bool
- func (s *IOStreams) ColorScheme() *ColorScheme
- func (s *IOStreams) ConfirmAction(prompt string) (bool, error)
- func (s *IOStreams) IsStderrTTY() bool
- func (s *IOStreams) IsStdinTTY() bool
- func (s *IOStreams) IsStdoutTTY() bool
- func (s *IOStreams) NewTablePrinter() *TablePrinter
- func (s *IOStreams) OpenInBrowser(url string) error
- func (s *IOStreams) StartPager() error
- func (s *IOStreams) StartSpinner(label string)
- func (s *IOStreams) StopPager()
- func (s *IOStreams) StopSpinner()
- func (s *IOStreams) TerminalWidth() int
- type TablePrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorScheme ¶
type ColorScheme struct {
// contains filtered or unexported fields
}
ColorScheme provides semantic color methods that respect whether color output is enabled.
func NewColorScheme ¶
func NewColorScheme(enabled bool) *ColorScheme
NewColorScheme creates a ColorScheme. When enabled is false, all methods return undecorated text.
func (*ColorScheme) FailureIcon ¶
func (cs *ColorScheme) FailureIcon() string
FailureIcon returns a red X mark if color is enabled, plain otherwise.
func (*ColorScheme) Green ¶
func (cs *ColorScheme) Green(s string) string
Green renders text in green.
func (*ColorScheme) Magenta ¶
func (cs *ColorScheme) Magenta(s string) string
Magenta renders text in magenta.
func (*ColorScheme) Muted ¶
func (cs *ColorScheme) Muted(s string) string
Muted renders text in gray (dimmed).