Documentation
¶
Index ¶
- func Flatten(value any) map[string]string
- func FprintFlat(w io.Writer, b []byte)
- func PrintFlat(b []byte)
- func RelaxedJSONPathExpression(pathExpression string) (string, error)
- func SprintFlat(b []byte) string
- func SprintFlatColor(b []byte, colorize *palette.ColorPaletteFunc) string
- type Delta
- type RenderFunc
- type Renderer
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Flatten ¶
Flatten accepts a nested struct and returns a flat struct with key like a."b/c".d[0].e
func FprintFlat ¶
func RelaxedJSONPathExpression ¶
RelaxedJSONPathExpression attempts to be flexible with JSONPath expressions, it accepts:
- metadata.name (no leading '.' or curly braces '{...}'
- {metadata.name} (no leading '.')
- .metadata.name (no curly braces '{...}')
- {.metadata.name} (complete expression)
And transforms them all into a valid jsonpath expression:
{.metadata.name}
func SprintFlat ¶
SprintFlat accepts a JSON formatted byte array and returns the sorted "key = val" buffer
func SprintFlatColor ¶
func SprintFlatColor(b []byte, colorize *palette.ColorPaletteFunc) string
Types ¶
type Delta ¶
type Delta struct {
// contains filtered or unexported fields
}
func (*Delta) KeysToDelete ¶
type RenderFunc ¶
type RenderFunc func() string
RenderFunc is the protype of human format renderer functions.
type Renderer ¶
type Renderer struct {
DefaultOutput string
Output string
Color string
Data any
HumanRenderer RenderFunc
Colorize *palette.ColorPaletteFunc
Stream bool
}
Renderer hosts the renderer options and data, and exposes the rendering method.
type T ¶
type T int
T encodes as an integer one of the supported output formats (json, flat, human, table, csv)
const ( // Human is the preferred human friendly custom output format Human T = iota // JSON is the json output format JSON // Flat is the flattened json output format (a."b#b".c = d, a[0] = b) Flat // JSONLine is unindented json output format JSONLine // Tab is the customizable tabular output format Tab // Table is the simple tabular output format Table // CSV is the csv tabular output format CSV // YAML is the standard human readable, commentable, complex data representation YAML // Template is a custom user provided renderer Template )
func (T) MarshalText ¶
MarshalText marshals the enum as a quoted json string
func (*T) UnmarshalText ¶
UnmarshalText unmashals a quoted json string to the enum value