mirror of
https://github.com/octoleo/restic.git
synced 2024-11-30 00:33:57 +00:00
commit
871c817f66
19
progress.go
19
progress.go
@ -86,16 +86,6 @@ func (p *Progress) Report(s Stat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report a file with the given size.
|
|
||||||
func (p *Progress) ReportFile(size uint64) {
|
|
||||||
p.Report(Stat{Files: 1, Bytes: size})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Report a directory.
|
|
||||||
func (p *Progress) ReportDir() {
|
|
||||||
p.Report(Stat{Dirs: 1})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *Progress) reporter() {
|
func (p *Progress) reporter() {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return
|
return
|
||||||
@ -157,15 +147,6 @@ func (p *Progress) Done() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current returns the current stat value.
|
|
||||||
func (p *Progress) Current() Stat {
|
|
||||||
p.curM.Lock()
|
|
||||||
s := p.cur
|
|
||||||
p.curM.Unlock()
|
|
||||||
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add accumulates other into s.
|
// Add accumulates other into s.
|
||||||
func (s *Stat) Add(other Stat) {
|
func (s *Stat) Add(other Stat) {
|
||||||
s.Bytes += other.Bytes
|
s.Bytes += other.Bytes
|
||||||
|
Loading…
Reference in New Issue
Block a user