Documentation ¶
Index ¶
- type Counter
- type JSONProgress
- func (b *JSONProgress) CompleteItem(messageType, item string, s archiver.ItemStats, d time.Duration)
- func (b *JSONProgress) Error(item string, err error) error
- func (b *JSONProgress) Finish(snapshotID restic.ID, start time.Time, summary *Summary, dryRun bool)
- func (b *JSONProgress) ReportTotal(start time.Time, s archiver.ScanStats)
- func (b *JSONProgress) Reset()
- func (b *JSONProgress) ScannerError(item string, err error) error
- func (b *JSONProgress) Update(total, processed Counter, errors uint, currentFiles map[string]struct{}, ...)
- type Progress
- func (p *Progress) CompleteBlob(bytes uint64)
- func (p *Progress) CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, ...)
- func (p *Progress) Error(item string, err error) error
- func (p *Progress) Finish(snapshotID restic.ID, dryrun bool)
- func (p *Progress) ReportTotal(item string, s archiver.ScanStats)
- func (p *Progress) StartFile(filename string)
- type ProgressPrinter
- type Summary
- type TextProgress
- func (b *TextProgress) CompleteItem(messageType, item string, s archiver.ItemStats, d time.Duration)
- func (b *TextProgress) Error(_ string, err error) error
- func (b *TextProgress) Finish(_ restic.ID, start time.Time, summary *Summary, dryRun bool)
- func (b *TextProgress) ReportTotal(start time.Time, s archiver.ScanStats)
- func (b *TextProgress) Reset()
- func (b *TextProgress) ScannerError(_ string, err error) error
- func (b *TextProgress) Update(total, processed Counter, errors uint, currentFiles map[string]struct{}, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONProgress ¶
JSONProgress reports progress for the `backup` command in JSON.
func NewJSONProgress ¶
func NewJSONProgress(term *termstatus.Terminal, verbosity uint) *JSONProgress
NewJSONProgress returns a new backup progress reporter.
func (*JSONProgress) CompleteItem ¶
func (b *JSONProgress) CompleteItem(messageType, item string, s archiver.ItemStats, d time.Duration)
CompleteItem is the status callback function for the archiver when a file/dir has been saved successfully.
func (*JSONProgress) Error ¶
func (b *JSONProgress) Error(item string, err error) error
Error is the error callback function for the archiver, it prints the error and returns nil.
func (*JSONProgress) ReportTotal ¶
func (b *JSONProgress) ReportTotal(start time.Time, s archiver.ScanStats)
ReportTotal sets the total stats up to now
func (*JSONProgress) ScannerError ¶
func (b *JSONProgress) ScannerError(item string, err error) error
ScannerError is the error callback function for the scanner, it prints the error in verbose mode and returns nil.
type Progress ¶
Progress reports progress for the `backup` command.
func NewProgress ¶
func NewProgress(printer ProgressPrinter, interval time.Duration) *Progress
func (*Progress) CompleteBlob ¶
CompleteBlob is called for all saved blobs for files.
func (*Progress) CompleteItem ¶
func (p *Progress) CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration)
CompleteItem is the status callback function for the archiver when a file/dir has been saved successfully.
func (*Progress) Error ¶
Error is the error callback function for the archiver, it prints the error and returns nil.
func (*Progress) ReportTotal ¶
ReportTotal sets the total stats up to now
type ProgressPrinter ¶
type ProgressPrinter interface { Update(total, processed Counter, errors uint, currentFiles map[string]struct{}, start time.Time, secs uint64) Error(item string, err error) error ScannerError(item string, err error) error CompleteItem(messageType string, item string, s archiver.ItemStats, d time.Duration) ReportTotal(start time.Time, s archiver.ScanStats) Finish(snapshotID restic.ID, start time.Time, summary *Summary, dryRun bool) Reset() P(msg string, args ...interface{}) V(msg string, args ...interface{}) }
A ProgressPrinter can print various progress messages. It must be safe to call its methods from concurrent goroutines.
type TextProgress ¶
TextProgress reports progress for the `backup` command.
func NewTextProgress ¶
func NewTextProgress(term *termstatus.Terminal, verbosity uint) *TextProgress
NewTextProgress returns a new backup progress reporter.
func (*TextProgress) CompleteItem ¶
func (b *TextProgress) CompleteItem(messageType, item string, s archiver.ItemStats, d time.Duration)
CompleteItem is the status callback function for the archiver when a file/dir has been saved successfully.
func (*TextProgress) Error ¶
func (b *TextProgress) Error(_ string, err error) error
Error is the error callback function for the archiver, it prints the error and returns nil.
func (*TextProgress) ReportTotal ¶
func (b *TextProgress) ReportTotal(start time.Time, s archiver.ScanStats)
ReportTotal sets the total stats up to now
func (*TextProgress) ScannerError ¶
func (b *TextProgress) ScannerError(_ string, err error) error
ScannerError is the error callback function for the scanner, it prints the error in verbose mode and returns nil.