Documentation
¶
Index ¶
- Constants
- Variables
- func BgGreenS(s string) string
- func BgRedS(s string) string
- func BlueS(s string) string
- func BoldS(s string) string
- func ColorizeDist[T int | float32 | float64](s string, v T, points []T, colors []string) string
- func ColorizeMinMax[T int | float32 | float64](s string, v, min, max T, minC, maxC string) string
- func DimS(s string) string
- func GreenS(s string) string
- func HeaderTo(w io.StringWriter, title string)
- func RedS(s string) string
- func VolumeBar[T int | int32 | int64 | float32 | float64](v, max T, width int) string
- func YellowS(s string) string
- type Alignment
- type TablCol
- type TableWriter
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[91m" Green = "\033[92m" Yellow = "\033[93m" Blue = "\033[94m" Magenta = "\033[95m" Cyan = "\033[96m" Dim = "\033[2m" Bold = "\033[1m" BgRed = "\033[41m" BgGreen = "\033[42m" BgYellow = "\033[43m" )
Variables ¶
View Source
var EnableColor = os.Getenv("NO_COLOR") == ""
Functions ¶
func ColorizeDist ¶ added in v0.1.9
ColorizeDist colorizes s based on which interval v falls into. points must be sorted ascending; colors must have len(points)+1 elements. colors[0]: v < points[0] colors[i]: points[i-1] <= v < points[i] colors[len(points)]: v >= points[len(points)-1]
func ColorizeMinMax ¶ added in v0.1.2
func HeaderTo ¶ added in v0.1.8
func HeaderTo(w io.StringWriter, title string)
Types ¶
type TableWriter ¶
type TableWriter struct {
Indent string
Cols []TablCol
ColDefault map[string]TablCol
Out interface {
WriteString(s string) (n int, err error)
}
}
TableWriter provides simple table formatting with ANSI color support. Values that are too long will get truncated into column width.
func (TableWriter) WriteHeader ¶
func (s TableWriter) WriteHeader()
func (TableWriter) WriteHeaderLine ¶
func (s TableWriter) WriteHeaderLine()
func (TableWriter) WriteRow ¶
func (s TableWriter) WriteRow(vs ...string)
func (TableWriter) WriteSubHeader ¶
func (s TableWriter) WriteSubHeader(vs ...string)
Click to show internal directories.
Click to hide internal directories.