progress

package
v0.10.257 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package progress writes structured progress breadcrumbs to stderr for long-running CLI work.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock func() time.Time

Clock returns the current time.

type Field added in v0.9.178

type Field struct {
	Key   string
	Value string
}

Field is one additional structured progress attribute.

type Logger

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

Logger writes structured progress lines.

func New

func New(w io.Writer, disabled bool, now Clock) *Logger

New returns a logger that writes progress to w unless disabled is true.

func (*Logger) Start

func (l *Logger) Start(command, op, target string) *Span

Start writes a start line and returns a span that can be ended exactly once.

func (*Logger) StartFields added in v0.9.178

func (l *Logger) StartFields(command, op, target string, fields ...Field) *Span

StartFields writes a start line with additional structured fields and returns a span that can be ended exactly once.

type Span

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

Span represents one started progress operation.

func (*Span) End

func (s *Span) End(err error) error

End writes a finish or error line and returns err. It is a no-op for disabled loggers or a span that has already ended.

func (*Span) EndFields added in v0.9.178

func (s *Span) EndFields(err error, fields ...Field)

EndFields writes a finish or error line with additional structured fields. It is a no-op for disabled loggers or a span that has already ended.

Jump to

Keyboard shortcuts

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