progress

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Progress

type Progress struct {
	OnStart  func()
	OnUpdate ProgressFunc
	OnDone   ProgressFunc
	OnCancel ProgressFunc
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(d time.Duration) *Progress

func (*Progress) Cancel added in v1.0.18

func (p *Progress) Cancel()

func (*Progress) Done

func (p *Progress) Done()

func (*Progress) Report

func (p *Progress) Report(s Stat)

Report adds the statistics from s to the current state and tries to report the accumulated statistics via the feedback channel.

func (*Progress) Reset

func (p *Progress) Reset()

Reset resets all statistic counters to zero.

func (*Progress) Start

func (p *Progress) Start()

Start resets and runs the progress reporter.

type ProgressFunc

type ProgressFunc func(s Stat, runtime time.Duration, ticker bool)

type Stat

type Stat struct {
	Items    uint64
	Bytes    uint64
	Storage  uint64
	Errors   bool
	ItemName []string
}

Stat

func (*Stat) Add

func (s *Stat) Add(other Stat)

Add accumulates other into s.

func (Stat) String

func (s Stat) String() string

Jump to

Keyboard shortcuts

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