output

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal() bool

IsTerminal reports whether stdout is a terminal.

Types

type Column

type Column struct {
	Header string
	Width  int
}

Column defines a table column.

type Formatter

type Formatter interface {
	Format(data any) (string, error)
}

Formatter formats data for output.

func NewFormatter

func NewFormatter(jsonMode bool, format string, noColor bool) Formatter

NewFormatter creates the appropriate formatter based on flags.

type JSONFormatter

type JSONFormatter struct{}

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(data any) (string, error)

type TableFormatter

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

func NewTableFormatter

func NewTableFormatter(columns []Column, noColor bool) *TableFormatter

func (*TableFormatter) FormatRows

func (f *TableFormatter) FormatRows(rows [][]string) string

type TemplateFormatter

type TemplateFormatter struct {
	Template string
}

func (*TemplateFormatter) Format

func (f *TemplateFormatter) Format(data any) (string, error)

Jump to

Keyboard shortcuts

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