Documentation ¶
Index ¶
- type Color
- type Colors
- func (c Colors) AppendBool(b []byte, v bool) []byte
- func (c Colors) AppendInt64(b []byte, v int64) []byte
- func (c Colors) AppendKey(b, v []byte) []byte
- func (c Colors) AppendNull(b []byte) []byte
- func (c Colors) AppendPunc(b []byte, v byte) []byte
- func (c Colors) AppendUint64(b []byte, v uint64) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color struct { // Prefix is the terminal color code prefix to print before the value (may be empty). Prefix []byte // Suffix is the terminal color code suffix to print after the value (may be empty). Suffix []byte }
Color is used to render terminal colors. The Prefix value is written, then the actual value, then the suffix.
type Colors ¶
type Colors struct { Null Color Bool Color Number Color String Color Key Color Bytes Color Time Color Punc Color }
Colors encapsulates colorization of JSON output.
func NewColors ¶
func NewColors(fm *output.Formatting) Colors
NewColors builds a Colors instance from a Formatting instance.
func (Colors) AppendBool ¶
AppendBool appends the colorized bool v to b.
func (Colors) AppendInt64 ¶
AppendInt64 appends the colorized int64 v to b.
func (Colors) AppendNull ¶
AppendNull appends a colorized "null" to b.
func (Colors) AppendPunc ¶
AppendPunc appends the colorized punctuation mark v to b.
Click to show internal directories.
Click to hide internal directories.