Documentation ¶
Index ¶
- Variables
- func Bold(text string) string
- func Color(w io.Writer) aurora.Aurora
- func ColorizeJSON(json string, darkStyle bool, w io.Writer) string
- func ColorizeStatus(status int) aurora.Value
- func Faint(text string) string
- func Italic(text string) string
- func Linkify(text, url string, w io.Writer) string
- func StartNewSpinner(msg string, w io.Writer) *spinner.Spinner
- func StartSpinner(s *spinner.Spinner, msg string, w io.Writer)
- func StopSpinner(s *spinner.Spinner, msg string, w io.Writer)
- func StrikeThrough(text string) string
Constants ¶
This section is empty.
Variables ¶
var DisableColors = false
DisableColors disables all colors and other ANSI sequences.
var EnvironmentOverrideColors = true
EnvironmentOverrideColors overs coloring based on `CLICOLOR` and `CLICOLOR_FORCE`. Cf. https://bixense.com/clicolors/
var ForceColors = false
ForceColors forces the use of colors and other ANSI sequences.
var HostStderrIsTerminal = true
HostStderrIsTerminal enables color on stderr output when this package is used in a plugin.
var HostStdoutIsTerminal = true
HostStdoutIsTerminal enables color on stdout output when this package is used in a plugin.
Functions ¶
func Color ¶
Color returns an aurora.Aurora instance with colors enabled or disabled depending on whether the writer supports colors.
func ColorizeJSON ¶
ColorizeJSON returns a colorized version of the input JSON, if the writer supports colors.
func ColorizeStatus ¶ added in v0.6.3
ColorizeStatus returns a colorized number for HTTP status code
func Linkify ¶
Linkify returns an ANSI escape sequence with an hyperlink, if the writer supports colors.
func StartNewSpinner ¶ added in v1.4.3
StartNewSpinner starts a new spinner with the given message. If the writer is not a terminal or doesn't support colors, it simply prints the message.
func StartSpinner ¶
StartSpinner updates an existing spinner's message, and starts it if it was stopped
func StopSpinner ¶
StopSpinner stops a spinner with the given message. If the writer is not a terminal or doesn't support colors, it simply prints the message.
func StrikeThrough ¶ added in v0.5.2
StrikeThrough returns struck though text if the writer supports colors
Types ¶
This section is empty.