Documentation
¶
Index ¶
Constants ¶
View Source
const ( ColorBlack int = iota + 30 ColorRed ColorGreen ColorYellow ColorBlue ColorMagenta ColorCyan ColorWhite )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSONPrinter ¶
type JSONPrinter struct {
// contains filtered or unexported fields
}
JSONPrinter is a StringPrinter which supports indentation and syntax highlighting for printing JSON to a terminal window using ANSI codes to define the syntax colours.
func NewJSONPrinter ¶
func NewJSONPrinter() *JSONPrinter
NewJSONPrinter returns the default instance of JSONPrinter with a default indentation setting of 2 spaces.
func (*JSONPrinter) PrintString ¶
func (jp *JSONPrinter) PrintString(w io.Writer, a string)
PrintString prints a JSON string to an io.Writer, after scanning and syntax highlighting via ANSI codes has taken place.
type StringPrinter ¶
StringPrinter defines the behaviour of an object which must be able to 'PrintString', by a passed string, through to an instance of io.Writer.
Click to show internal directories.
Click to hide internal directories.