progress

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package progress provides progress reporting for batch conversions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONLog

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

JSONLog emits one JSON object per event (suitable for --json / CI=1).

func NewJSONLog

func NewJSONLog(w io.Writer) *JSONLog

NewJSONLog creates a JSON-line reporter writing to w.

func (*JSONLog) Done

func (j *JSONLog) Done()

func (*JSONLog) Start

func (j *JSONLog) Start(n int)

func (*JSONLog) Update

func (j *JSONLog) Update(done, total int, name string, err error)

type Noop

type Noop struct{}

Noop is a reporter that discards all events (used with --quiet).

func (Noop) Done

func (Noop) Done()

func (Noop) Start

func (Noop) Start(_ int)

func (Noop) Update

func (Noop) Update(_, _ int, _ string, _ error)

type Plain

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

Plain writes one line per job to w (suitable for non-TTY or --quiet mode).

func NewPlain

func NewPlain(w io.Writer) *Plain

NewPlain creates a plain-text reporter writing to w.

func (*Plain) Done

func (p *Plain) Done()

func (*Plain) Start

func (p *Plain) Start(n int)

func (*Plain) Update

func (p *Plain) Update(done, total int, name string, err error)

type Reporter

type Reporter interface {
	// Start signals that a batch of n jobs is beginning.
	Start(n int)
	// Update is called after each job completes (successfully or not).
	Update(done, total int, name string, err error)
	// Done signals that all jobs have finished.
	Done()
}

Reporter is the interface all progress implementations satisfy.

type TUI

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

TUI renders a simple in-place progress bar for TTY output. It falls back to plain-text behaviour for non-TTY destinations.

func NewTUI

func NewTUI(w io.Writer, isTTY bool) *TUI

NewTUI creates a TUI reporter. Pass isTTY=true when w is a terminal.

func (*TUI) Done

func (t *TUI) Done()

func (*TUI) Start

func (t *TUI) Start(n int)

func (*TUI) Update

func (t *TUI) Update(done, total int, name string, err error)

Jump to

Keyboard shortcuts

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