formatters

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter renders output as JSON

func NewJSONFormatter

func NewJSONFormatter() *JSONFormatter

NewJSONFormatter creates a new JSON formatter

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(b format.Buildable) (string, error)

Format renders a single buildable structure

func (*JSONFormatter) FormatMultiple

func (f *JSONFormatter) FormatMultiple(builders []format.Buildable) (string, error)

FormatMultiple renders multiple buildable structures

func (*JSONFormatter) Name

func (f *JSONFormatter) Name() string

Name returns the formatter name

func (*JSONFormatter) SupportsColors

func (f *JSONFormatter) SupportsColors() bool

SupportsColors returns false (JSON doesn't support colors)

type TextFormatter

type TextFormatter struct {
	// contains filtered or unexported fields
}

TextFormatter renders output as plain text with box-drawing characters

func NewTextFormatter

func NewTextFormatter(useColors bool) *TextFormatter

NewTextFormatter creates a new text formatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(b format.Buildable) (string, error)

Format renders a single buildable structure

func (*TextFormatter) FormatMultiple

func (f *TextFormatter) FormatMultiple(builders []format.Buildable) (string, error)

FormatMultiple renders multiple buildable structures

func (*TextFormatter) Name

func (f *TextFormatter) Name() string

Name returns the formatter name

func (*TextFormatter) SupportsColors

func (f *TextFormatter) SupportsColors() bool

SupportsColors returns true if the formatter supports color output

type XMLFormatter

type XMLFormatter struct{}

XMLFormatter renders output as XML

func NewXMLFormatter

func NewXMLFormatter() *XMLFormatter

NewXMLFormatter creates a new XML formatter

func (*XMLFormatter) Format

func (f *XMLFormatter) Format(b format.Buildable) (string, error)

Format renders a single buildable structure

func (*XMLFormatter) FormatMultiple

func (f *XMLFormatter) FormatMultiple(builders []format.Buildable) (string, error)

FormatMultiple renders multiple buildable structures

func (*XMLFormatter) Name

func (f *XMLFormatter) Name() string

Name returns the formatter name

func (*XMLFormatter) SupportsColors

func (f *XMLFormatter) SupportsColors() bool

SupportsColors returns false (XML doesn't support colors)

type YAMLFormatter

type YAMLFormatter struct{}

YAMLFormatter renders output as YAML

func NewYAMLFormatter

func NewYAMLFormatter() *YAMLFormatter

NewYAMLFormatter creates a new YAML formatter

func (*YAMLFormatter) Format

func (f *YAMLFormatter) Format(b format.Buildable) (string, error)

Format renders a single buildable structure

func (*YAMLFormatter) FormatMultiple

func (f *YAMLFormatter) FormatMultiple(builders []format.Buildable) (string, error)

FormatMultiple renders multiple buildable structures

func (*YAMLFormatter) Name

func (f *YAMLFormatter) Name() string

Name returns the formatter name

func (*YAMLFormatter) SupportsColors

func (f *YAMLFormatter) SupportsColors() bool

SupportsColors returns false (YAML doesn't support colors)

Jump to

Keyboard shortcuts

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