output

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(data interface{}, format string) error

Print outputs data in the specified format

func PrintError

func PrintError(err error) error

PrintError outputs an error in JSON format

func PrintTo

func PrintTo(data interface{}, format string, w io.Writer) error

PrintTo outputs data to the specified writer

Types

type Formatter

type Formatter interface {
	Format(data interface{}) error
}

Formatter defines the output formatter interface

type JSONFormatter

type JSONFormatter struct {
	Writer io.Writer
}

JSONFormatter formats output as JSON

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(data interface{}) error

Format outputs data as formatted JSON

type TableFormatter

type TableFormatter struct {
	Writer io.Writer
}

TableFormatter formats output as a table

func (*TableFormatter) Format

func (f *TableFormatter) Format(data interface{}) error

Format outputs data as a table

Jump to

Keyboard shortcuts

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