Documentation
¶
Index ¶
- Constants
- Variables
- func FormatBytes(value uint64) string
- func FormatETA(seconds uint64) string
- func FormatElapsed(elapsed time.Duration) string
- func FormatProgress(snapshot appobs.ProgressSnapshot, metrics ProgressMetrics, ...) terminalcanvas.Line
- func FormatRate(bytesPerSecond uint64) string
- type Config
- type ProgressLayout
- type ProgressMetrics
- type Renderer
- type Symbols
Constants ¶
const ConfigureRelaysGuidance = "configure relay candidates with wind config import <file|->, or pass --relay for this share"
Variables ¶
var ErrInvalidConfig = errors.New("human output configuration is invalid")
Functions ¶
func FormatBytes ¶
FormatBytes uses SI decimal units because progress describes transfer bytes, not filesystem allocation units.
func FormatElapsed ¶
func FormatProgress ¶
func FormatProgress( snapshot appobs.ProgressSnapshot, metrics ProgressMetrics, layout ProgressLayout, ) terminalcanvas.Line
FormatProgress is pure: rate eligibility is supplied as a fact, while this function owns only progress truth rules and width degradation.
func FormatRate ¶
Types ¶
type Config ¶
type Config struct {
Canvas *terminalcanvas.Canvas
Capabilities terminalcanvas.CapabilityProvider
Clock terminalcanvas.Clock
CellWidth terminalcanvas.CellWidthFunc
Verbose bool
}
Config keeps presentation policy independent from the Canvas that owns stderr. Capabilities are shared with Canvas so visibility, symbols, and width decisions describe the same terminal snapshot used for the eventual write.
type ProgressLayout ¶
type ProgressLayout struct {
Columns int
Unicode bool
CellWidth terminalcanvas.CellWidthFunc
}
type ProgressMetrics ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer serializes command events into semantic terminal lines. Writer failures remain observable only through Canvas.Err and never become command failures through Render.
func (*Renderer) Render ¶
Render consumes immutable application facts and command presentation results. Calls are serialized because rate samples and redirected phase transitions are command-scoped state even when producers happen to be concurrent.
func (*Renderer) RenderTerminal ¶
func (renderer *Renderer) RenderTerminal(event clievent.TerminalEvent) error
RenderTerminal is intentionally separate from Render: a running command can drain ordinary work without accidentally presenting authority before trace sealing has made diagnostic completeness final.
func (*Renderer) RenderTracePath ¶
RenderTracePath reports only local human state. The generated path is escaped before layout and is never modeled as a trace event, avoiding self-disclosure in the NDJSON artifact.
type Symbols ¶
type Symbols struct {
Ready, Arrow, Sharing, Relay, Waiting, Path, Discovery string
Success, Warning, Failure, Paused string
Separator, Ellipsis string
}
Symbols keeps Unicode capability independent from interactivity and ANSI. ASCII output remains meaningful instead of relying on font replacement glyphs.