internal

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

func (c Colors) AppendBool(b []byte, v bool) []byte

AppendBool appends the colorized bool v to b.

func (Colors) AppendInt64

func (c Colors) AppendInt64(b []byte, v int64) []byte

AppendInt64 appends the colorized int64 v to b.

func (Colors) AppendKey

func (c Colors) AppendKey(b, v []byte) []byte

AppendKey appends the colorized key v to b.

func (Colors) AppendNull

func (c Colors) AppendNull(b []byte) []byte

AppendNull appends a colorized "null" to b.

func (Colors) AppendPunc

func (c Colors) AppendPunc(b []byte, v byte) []byte

AppendPunc appends the colorized punctuation mark v to b.

func (Colors) AppendUint64

func (c Colors) AppendUint64(b []byte, v uint64) []byte

AppendUint64 appends the colorized uint64 v to b.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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