progress

package
v1.3.43 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package progress provides progress reporting functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadCloser

func ReadCloser(contentLength int64, r io.Reader, saveFilename string) io.ReadCloser

Reader returns an io.ReadCloser that copies every byte read into a progress bar.

func Reader

func Reader(contentLength int64, reader io.Reader, saveFilename string) (io.Reader, func())

func SuppressLog added in v1.3.41

func SuppressLog() bool

SuppressLog reports whether the process is running in a CI/non-interactive environment. It checks the CI environment variable, which is set automatically by GitHub Actions, GitLab CI, CircleCI, Travis CI, Jenkins, and most other CI systems.

Types

type BarWriter

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

func (*BarWriter) Write

func (w *BarWriter) Write(p []byte) (int, error)

type ConsoleReporter

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

ConsoleReporter implements Reporter by printing messages to console

func NewConsoleReporter

func NewConsoleReporter() *ConsoleReporter

NewConsoleReporter creates a new ConsoleReporter

func (*ConsoleReporter) End

func (r *ConsoleReporter) End()

func (*ConsoleReporter) Error

func (r *ConsoleReporter) Error(message string)

func (*ConsoleReporter) Start

func (r *ConsoleReporter) Start(message string)

func (*ConsoleReporter) Step

func (r *ConsoleReporter) Step(message string)

func (*ConsoleReporter) Success

func (r *ConsoleReporter) Success(message string)

type NopReporter

type NopReporter struct{}

NopReporter implements Reporter with no-op operations

func NewNopReporter

func NewNopReporter() *NopReporter

NewNopReporter creates a new NopReporter

func (*NopReporter) End

func (r *NopReporter) End()

func (*NopReporter) Error

func (r *NopReporter) Error(message string)

func (*NopReporter) Start

func (r *NopReporter) Start(message string)

func (*NopReporter) Step

func (r *NopReporter) Step(message string)

func (*NopReporter) Success

func (r *NopReporter) Success(message string)

type Reporter

type Reporter interface {
	// Start begins progress reporting with an initial message
	Start(message string)

	// Step reports a new step in the operation
	Step(message string)

	// Error reports an error condition
	Error(message string)

	// Success reports successful completion
	Success(message string)

	// End finalizes progress reporting
	End()
}

Reporter defines the interface for reporting progress. It provides methods to report different stages of an operation and its status.

Jump to

Keyboard shortcuts

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