tracker

package
v1.15.32 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tracker provides progress tracking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteTrackerFilter

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

ByteTrackerFilter takes updates of the number of bytes processed/transferred and produces estimates of the time to complete and speed.

func NewByteTrackerFilter

func NewByteTrackerFilter() *ByteTrackerFilter

NewByteTrackerFilter constructs a new byte tracker filter.

func (*ByteTrackerFilter) Add

func (bt *ByteTrackerFilter) Add(t time.Time, complete, total int64)

Add adds to the complete and total at the given time.

func (*ByteTrackerFilter) Completed

func (bt *ByteTrackerFilter) Completed() int64

Completed returns the number of completed bytes.

func (*ByteTrackerFilter) Format

func (bt *ByteTrackerFilter) Format(short bool) string

Format the byte tracker data.

func (*ByteTrackerFilter) FormatCompleted

func (bt *ByteTrackerFilter) FormatCompleted(dt time.Duration) string

FormatCompleted returns the final formatted completion message.

func (*ByteTrackerFilter) String

func (bt *ByteTrackerFilter) String() string

String implements fmt.Stringer interface.

func (*ByteTrackerFilter) Total

func (bt *ByteTrackerFilter) Total() int64

Total returns the total number of bytes.

type Counter

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

Counter represents a simple counter.

func NewCounter

func NewCounter() *Counter

NewCounter creates a new counter.

func (*Counter) AddCompleted

func (c *Counter) AddCompleted(x int)

AddCompleted adds to the completed count.

func (*Counter) AddTotal

func (c *Counter) AddTotal(x int)

AddTotal adds to the total count.

func (*Counter) Completed

func (c *Counter) Completed() int

Completed returns the number of completed tasks.

func (*Counter) Done

func (c *Counter) Done() bool

Done returns true when all the tasks have completed.

func (*Counter) Format

func (c *Counter) Format(short bool) string

Format the counter data.

func (*Counter) String

func (c *Counter) String() string

String implements fmt.Stringer interface.

func (*Counter) Total

func (c *Counter) Total() int

Total returns the total number of tasks.

Jump to

Keyboard shortcuts

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