Documentation
¶
Index ¶
- type Counter
- type Progress
- func (p *Progress) CompleteBlob(filename string, bytes uint64)
- func (p *Progress) CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, ...)
- func (p *Progress) Error(item string, fi os.FileInfo, err error) error
- func (p *Progress) Finish(snapshotID restic.ID)
- func (p *Progress) ReportTotal(item string, s archiver.ScanStats)
- func (p *Progress) Run(ctx context.Context) error
- func (p *Progress) ScannerError(item string, fi os.FileInfo, err error) error
- func (p *Progress) SetDryRun()
- func (p *Progress) SetMinUpdatePause(d time.Duration)
- func (p *Progress) StartFile(filename string)
- type ProgressPrinter
- type ProgressReporter
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Progress ¶
Progress reports progress for the `backup` command.
func NewProgress ¶
func NewProgress(printer ProgressPrinter) *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
func (*Progress) Run ¶
Run regularly updates the status lines. It should be called in a separate goroutine.
func (*Progress) ScannerError ¶
ScannerError is the error callback function for the scanner, it prints the error in verbose mode and returns nil.
func (*Progress) SetDryRun ¶
func (p *Progress) SetDryRun()
SetDryRun marks the backup as a "dry run".
func (*Progress) SetMinUpdatePause ¶
SetMinUpdatePause sets b.MinUpdatePause. It satisfies the ArchiveProgressReporter interface.
type ProgressPrinter ¶
type ProgressPrinter interface { Update(total, processed Counter, avgSpeed uint64, errors uint, currentFiles map[string]struct{}, start time.Time, secs uint64) Error(item string, fi os.FileInfo, err error) error ScannerError(item string, fi os.FileInfo, err error) error CompleteItem(messageType string, item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration) ReportTotal(item string, start time.Time, s archiver.ScanStats) Finish(snapshotID restic.ID, start time.Time, summary *Summary, dryRun bool) Reset() // ui.StdioWrapper Stdout() io.WriteCloser Stderr() io.WriteCloser E(msg string, args ...interface{}) P(msg string, args ...interface{}) V(msg string, args ...interface{}) VV(msg string, args ...interface{}) }
type ProgressReporter ¶
type ProgressReporter interface { CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration) StartFile(filename string) CompleteBlob(filename string, bytes uint64) ScannerError(item string, fi os.FileInfo, err error) error ReportTotal(item string, s archiver.ScanStats) SetMinUpdatePause(d time.Duration) Run(ctx context.Context) error Error(item string, fi os.FileInfo, err error) error Finish(snapshotID restic.ID) }