Documentation
¶
Index ¶
- Constants
- func CalculateIncrementalUpdate(output *bufio.Writer, linesBefore []string, linesAfter []string)
- func CalculateIncrementalUpdateMaxLines(output *bufio.Writer, linesBefore []string, linesAfter []string, maxLines int)
- func GetColorSequence(code int) string
- func GetColoredText(color int, text string) string
- type ColorSchema
Constants ¶
const ( // BlackColor color BlackColor = iota // RedColor color RedColor // GreenColor color GreenColor // YellowColor color YellowColor // BlueColor color BlueColor // MagentaColor color MagentaColor // CyanColor color CyanColor // WhiteColor color WhiteColor )
const ResetSequence = "\033[0m"
ResetSequence reset ANSI sequence.
Variables ¶
This section is empty.
Functions ¶
func CalculateIncrementalUpdate ¶
CalculateIncrementalUpdate will update the output frame to output. the linesBefore is the prevoius frame, and the linesAfter is the newer frame waiting to output
func CalculateIncrementalUpdateMaxLines ¶
func CalculateIncrementalUpdateMaxLines(output *bufio.Writer, linesBefore []string, linesAfter []string, maxLines int)
CalculateIncrementalUpdateMaxLines will update frames to output with lines limitation.
The linesBefore is the prevoius frame, and the linesAfter is the newer frames waiting to output. The maxLines is the maximum lines allowed to output.
func GetColorSequence ¶
GetColorSequence will returns color control escape sequence
func GetColoredText ¶
GetColoredText will colorize text with color
Types ¶
type ColorSchema ¶
ColorSchema contains success/failure/neutral color
func DefaultColorSchema ¶
func DefaultColorSchema() *ColorSchema
DefaultColorSchema will returns a color schema
By default, success color is green, failure color is red, and neutral color is yellow