formatter

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format represents the output format

const (
	// FormatText represents text format
	FormatText Format = "text"
	// FormatJSON represents JSON format
	FormatJSON Format = "json"
	// FormatYAML represents YAML format
	FormatYAML Format = "yaml"
)

type Formatter

type Formatter struct {
	Format Format
	Writer io.Writer
	Color  bool
}

Formatter formats the output

func NewFormatter

func NewFormatter(format string, writer io.Writer, useColor bool) *Formatter

NewFormatter creates a new formatter

func (*Formatter) Print

func (f *Formatter) Print(data any) error

Print prints the data in the specified format

Jump to

Keyboard shortcuts

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