output

package
v0.4.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitWithError

func ExitWithError(err error, jsonOutput bool)

func PrintError

func PrintError(w io.Writer, err error, jsonOutput bool)

Types

type ErrorResponse

type ErrorResponse struct {
	SchemaVersion string `json:"schemaVersion"`
	Code          string `json:"code"`
	Message       string `json:"message"`
	ExitCode      int    `json:"exitCode"`
	RetryAfter    int    `json:"retryAfter,omitempty"`
}

type Formatter

type Formatter interface {
	Format(w io.Writer, data interface{}) error
	FormatList(w io.Writer, items []interface{}, headers []string) error
}

func NewFormatter

func NewFormatter(format string, fields []string, noHeaders bool) (Formatter, error)

type JSONFormatter

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

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(w io.Writer, data interface{}) error

func (*JSONFormatter) FormatList

func (f *JSONFormatter) FormatList(w io.Writer, items []interface{}, _ []string) error

type NDJSONFormatter

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

func (*NDJSONFormatter) Format

func (f *NDJSONFormatter) Format(w io.Writer, data interface{}) error

func (*NDJSONFormatter) FormatList

func (f *NDJSONFormatter) FormatList(w io.Writer, items []interface{}, _ []string) error

type TextFormatter

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

func (*TextFormatter) Format

func (f *TextFormatter) Format(w io.Writer, data interface{}) error

func (*TextFormatter) FormatList

func (f *TextFormatter) FormatList(w io.Writer, items []interface{}, headers []string) error

Jump to

Keyboard shortcuts

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