mirror of
https://github.com/restic/restic.git
synced 2025-03-13 15:50:56 +00:00
Progress: Add convenience functions
This commit is contained in:
parent
7558e99dd5
commit
d5dccd746e
10
progress.go
10
progress.go
@ -82,6 +82,16 @@ 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user