Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
Formatter writes structured data to output.
func NewFormatter ¶
func NewFormatter(mode OutputMode) Formatter
NewFormatter creates a formatter for the given mode.
type OutputMode ¶
type OutputMode int
OutputMode selects the output format.
const ( ModeTable OutputMode = iota ModeJSON ModePlain )
func DetectMode ¶
func DetectMode(jsonFlag, plainFlag bool) OutputMode
DetectMode returns the output mode from flags and env vars. Priority: explicit flag > env var > default (table).
func (OutputMode) String ¶
func (m OutputMode) String() string
type PaginatedResponse ¶
type PaginatedResponse struct {
Results any `json:"results"`
HasMore bool `json:"has_more"`
NextCursor string `json:"next_cursor,omitempty"`
}
PaginatedResponse wraps list results with pagination info.
type PlainFormatter ¶
type PlainFormatter struct{}
PlainFormatter outputs TSV (tab-separated values).
type TableFormatter ¶
type TableFormatter struct {
// Fields limits output to these columns. Nil = default columns.
Fields []string
// AllFields shows every available column.
AllFields bool
}
TableFormatter outputs aligned tables using tabwriter.
Click to show internal directories.
Click to hide internal directories.