renderer

package
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 8 Imported by: ? 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

Overview

Package renderer holds progress.Renderers that render a stream as JSON lines or log records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

JSON writes the stream as is, one event per line.

func NewJSON

func NewJSON(w io.Writer) *JSON

NewJSON returns a JSON renderer writing to w.

func (*JSON) Err

func (r *JSON) Err() error

Err returns the write that tore the stream, if any.

func (*JSON) Render

func (r *JSON) Render(evt progress.Event)

Render writes evt. After a failed write it writes nothing more: the stream is torn.

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log writes the stream as log records, one per event worth a line, each named by its node's path: album.publish[summer]/album.export/photo.resize/photo[beach.jpg].

func NewLog

func NewLog(logger zerolog.Logger) *Log

NewLog returns a Log renderer writing to logger.

func (*Log) Render

func (r *Log) Render(evt progress.Event)

Render logs evt unless it is a tick changing neither its message nor its count: bytes alone are not worth a line. A node is forgotten once it ends.

Directories

Path Synopsis
internal
format
Package format renders what the renderers print alike.
Package format renders what the renderers print alike.
Package tty renders a progress stream as a live tree on a terminal, through Bubble Tea.
Package tty renders a progress stream as a live tree on a terminal, through Bubble Tea.

Jump to

Keyboard shortcuts

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