progress

package
v0.0.0-...-cd881a2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWriter

func NewWriter(name string, total int64) io.WriteCloser

NewWriter creates a Writer that tracks the progress by the Write() call.

Types

type ProgressReporter

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

ProgressReporter aggregates the progress of multiple ReportingWriters.

func NewProgressReporter

func NewProgressReporter() *ProgressReporter

NewProgressReporter a ProgressReporter.

func (*ProgressReporter) NewWriter

func (r *ProgressReporter) NewWriter(name string) *ReportingWriter

NewWriter creates a ReportingWriter reporting to r.

func (*ProgressReporter) Report

func (r *ProgressReporter) Report() string

Report returns the aggregated progress of r.

type ReportingWriter

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

ReportingWriter is an io.Writer which reports its progress to a ProgressWriter.

func (*ReportingWriter) SetTotal

func (w *ReportingWriter) SetTotal(total int64)

SetTotal sets to total size to be written to w.

func (*ReportingWriter) Stats

func (w *ReportingWriter) Stats() (stats string, n, total int64)

Stats returns the local statistics to w.

func (*ReportingWriter) Write

func (w *ReportingWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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