output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 9 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 an output format type

const (
	FormatJSON  Format = "json"
	FormatYAML  Format = "yaml"
	FormatCSV   Format = "csv"
	FormatTable Format = "table"
)

type Writer

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

Writer handles output formatting and writing

func NewWriter

func NewWriter(format string, outputFile string) (*Writer, error)

NewWriter creates a new output writer

func (*Writer) Close

func (w *Writer) Close() error

Close closes the writer if it's a file

func (*Writer) WriteError

func (w *Writer) WriteError(err error) error

WriteError writes an error response

func (*Writer) WriteSuccess

func (w *Writer) WriteSuccess(data interface{}, meta *client.ResponseMeta) error

WriteSuccess writes a successful response

Jump to

Keyboard shortcuts

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