Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envelope ¶
type Envelope struct {
Version string `json:"version"`
Command string `json:"command"`
Timestamp time.Time `json:"timestamp"`
Success bool `json:"success"`
Results any `json:"results"`
Summary any `json:"summary,omitempty"`
Errors []string `json:"errors,omitempty"`
}
Envelope is the standard JSON output envelope.
func NewEnvelope ¶
NewEnvelope creates a new output envelope.
type Formatter ¶
type Formatter interface {
// Format writes the given data to the output.
Format(data any) error
// Writer returns the underlying writer.
Writer() io.Writer
}
Formatter is the interface for output formatting.
type JSONFormatter ¶
type JSONFormatter struct {
// contains filtered or unexported fields
}
JSONFormatter outputs JSON.
func (*JSONFormatter) Format ¶
func (f *JSONFormatter) Format(data any) error
func (*JSONFormatter) Writer ¶
func (f *JSONFormatter) Writer() io.Writer
type PlainFormatter ¶
type PlainFormatter struct {
// contains filtered or unexported fields
}
PlainFormatter outputs plain text, one item per line.
func (*PlainFormatter) Format ¶
func (f *PlainFormatter) Format(data any) error
func (*PlainFormatter) Writer ¶
func (f *PlainFormatter) Writer() io.Writer
type TableFormatter ¶
type TableFormatter struct {
// contains filtered or unexported fields
}
TableFormatter outputs human-readable tables.
func (*TableFormatter) Format ¶
func (f *TableFormatter) Format(data any) error
func (*TableFormatter) Writer ¶
func (f *TableFormatter) Writer() io.Writer
Click to show internal directories.
Click to hide internal directories.