output

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package output provides output formatting (JSON, CSV, TSV, human) for pdf-cli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputFormat

type OutputFormat string

OutputFormat represents the output format type.

const (
	FormatHuman OutputFormat = ""
	FormatJSON  OutputFormat = "json"
	FormatCSV   OutputFormat = "csv"
	FormatTSV   OutputFormat = "tsv"
)

func ParseOutputFormat

func ParseOutputFormat(s string) OutputFormat

ParseOutputFormat parses a string into an OutputFormat.

type OutputFormatter

type OutputFormatter struct {
	Format OutputFormat
	Writer io.Writer
}

OutputFormatter handles formatted output in various formats.

func NewOutputFormatter

func NewOutputFormatter(format string) *OutputFormatter

NewOutputFormatter creates a new OutputFormatter with the given format.

func (*OutputFormatter) IsStructured

func (f *OutputFormatter) IsStructured() bool

IsStructured returns true if the format is a structured format (JSON, CSV, TSV).

func (*OutputFormatter) Print

func (f *OutputFormatter) Print(data interface{}) error

Print outputs data in the configured format. For JSON, data is marshaled directly. For other formats, data should be a struct or map.

func (*OutputFormatter) PrintTable

func (f *OutputFormatter) PrintTable(headers []string, rows [][]string) error

PrintTable outputs tabular data in the configured format.

Jump to

Keyboard shortcuts

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