humanoutput

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ConfigureRelaysGuidance = "configure relay candidates with wind config import <file|->, or pass --relay for this share"

Variables

View Source
var ErrInvalidConfig = errors.New("human output configuration is invalid")

Functions

func FormatBytes

func FormatBytes(value uint64) string

FormatBytes uses SI decimal units because progress describes transfer bytes, not filesystem allocation units.

func FormatETA

func FormatETA(seconds uint64) string

func FormatElapsed

func FormatElapsed(elapsed time.Duration) string

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

func FormatRate(bytesPerSecond uint64) string

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 ProgressMetrics struct {
	RateBytesPerSecond   uint64
	RateValid            bool
	RateStable           bool
	SuccessfulSettlement bool
}

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 New

func New(config Config) (*Renderer, error)

func (*Renderer) Render

func (renderer *Renderer) Render(event clievent.Event) error

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

func (renderer *Renderer) RenderTracePath(path string) error

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.

func SelectSymbols

func SelectSymbols(unicode bool) Symbols

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL