common

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// RESET is the escape sequence for unsetting any previous commands.
	RESET = 0
	// ESC is the escape sequence used to send ANSI commands in the terminal.
	ESC = 27
)

Variables

This section is empty.

Functions

func SprintfWithColor

func SprintfWithColor(color Color, format string, a ...interface{}) string

SprintfWithColor formats according to the provided pattern and returns the result as a string with the necessary ansii escape codes for color

Types

type Color

type Color int

color is a type that captures the ANSI code for colors on the terminal.

var (
	RED    Color = 31
	GREEN  Color = 32
	YELLOW Color = 33
)

func ColorForStatus

func ColorForStatus(s status.Status) (color Color, setColor bool)

ColorForStatus returns the appropriate Color, which represents the ansii escape code, for different status values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL