Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorEnabled ¶ added in v3.17.0
func ColorEnabled() bool
ColorEnabled returns false when the NO_COLOR environment variable is present See https://no-color.org for the convention
func ValueOrDash ¶ added in v3.17.0
Types ¶
type Format ¶
type Format string
Format represents the output format type
const ( // FormatJSON outputs in JSON format FormatJSON Format = "json" // FormatYAML outputs in YAML format FormatYAML Format = "yaml" // FormatText outputs in plain text/default format FormatText Format = "text" DefaultFormat Format = FormatJSON )
type Formatter ¶
type Formatter interface {
// TextOutput returns the plain text representation
TextOutput() string
}
Formatter is an interface that types must implement to support formatted output
type Viewable ¶ added in v3.17.0
Viewable wraps any type to provide formatted output support. It delegates JSON/YAML marshaling directly to the underlying data, while using a custom render function for text output.
func (Viewable[T]) MarshalJSON ¶ added in v3.17.0
MarshalJSON delegates JSON marshaling to the underlying data.
func (Viewable[T]) MarshalYAML ¶ added in v3.17.0
MarshalYAML delegates YAML marshaling to the underlying data.
func (Viewable[T]) TextOutput ¶ added in v3.17.0
TextOutput implements the Formatter interface for text output.
Click to show internal directories.
Click to hide internal directories.