Documentation
¶
Overview ¶
Package inline implements the non-TUI inline status reporter.
Index ¶
- Variables
- func Chrome(format string, args ...any)
- func ChromeLn(format string, args ...any)
- func Data(format string, args ...any)
- func DataLn(format string, args ...any)
- func FormatStatusLine(stats *afclient.StatsResponse) string
- func PrintStatus(ds afclient.DataSource) error
- func RunWatch(ds afclient.DataSource, cfg WatchConfig) error
- type WatchConfig
Constants ¶
This section is empty.
Variables ¶
var ChromeWriter = os.Stderr
ChromeWriter writes to stderr — decorations, spinners, labels. This is where TUI chrome goes so it doesn't corrupt piped data.
var DataWriter = os.Stdout
DataWriter writes to stdout — data only, pipe-safe. This is where machine-parseable output goes.
Functions ¶
func Chrome ¶
Chrome prints decorative output to stderr if stderr is a TTY. When stderr is not a TTY (e.g., 2>/dev/null), chrome is suppressed.
func FormatStatusLine ¶
func FormatStatusLine(stats *afclient.StatsResponse) string
FormatStatusLine renders a one-line fleet summary from stats.
func PrintStatus ¶
func PrintStatus(ds afclient.DataSource) error
PrintStatus fetches fleet stats and prints a one-line summary to stdout. Chrome (header, timestamp) goes to stderr for pipe compatibility.
func RunWatch ¶
func RunWatch(ds afclient.DataSource, cfg WatchConfig) error
RunWatch starts a watch loop that refreshes status at the configured interval. For TTY stdout: overwrites the line in-place using \r and ANSI clear-to-EOL. For non-TTY stdout (piped): prints a new line each interval. For JSON mode: emits newline-delimited JSON (NDJSON). Handles SIGINT/SIGTERM gracefully, exiting with code 0.
Types ¶
type WatchConfig ¶
WatchConfig holds configuration for the watch loop.