Documentation
¶
Overview ¶
Package format provides common output formatting utilities for CLI commands.
Package format renders command output.
Index ¶
- func Any(data any, globalFlags *globals.Flags) error
- func Models(models []*catalogs.Model, showDetails bool, globalFlags *globals.Flags) error
- func Providers(providers []*catalogs.Provider, checker *auth.Checker, ...) error
- type Data
- type JSONFormatter
- type Kind
- type Renderer
- type RendererFunc
- type TableFormatter
- type YAMLFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Any ¶
Any handles the common pattern of formatting any data type for output. This is useful for commands with custom data structures.
Types ¶
type Data ¶
type Data struct {
Headers []string
Rows [][]string
ColumnAlignment []table.Align // Optional: column alignment (use table.AlignDefault, table.AlignLeft, table.AlignCenter, table.AlignRight)
}
Data represents data formatted for table output.
type Kind ¶ added in v0.2.0
type Kind string
Kind identifies an output format.
func DetectFormat ¶
DetectFormat auto-detects format based on terminal and environment.
func ParseFormat ¶
ParseFormat converts a string to Kind with validation.
type RendererFunc ¶ added in v0.2.0
RendererFunc allows functions to implement Renderer.
Click to show internal directories.
Click to hide internal directories.