Documentation ¶
Index ¶
- type Backup
- func (b *Backup) CompleteBlob(filename string, bytes uint64)
- func (b *Backup) CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, ...)
- func (b *Backup) Error(item string, fi os.FileInfo, err error) error
- func (b *Backup) Finish(snapshotID restic.ID)
- func (b *Backup) ReportTotal(item string, s archiver.ScanStats)
- func (b *Backup) Run(ctx context.Context) error
- func (b *Backup) ScannerError(item string, fi os.FileInfo, err error) error
- func (b *Backup) SetMinUpdatePause(d time.Duration)
- func (b *Backup) StartFile(filename string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct { *ui.Message *ui.StdioWrapper MinUpdatePause time.Duration // contains filtered or unexported fields }
Backup reports progress for the `backup` command in JSON.
func NewBackup ¶
func NewBackup(term *termstatus.Terminal, verbosity uint) *Backup
NewBackup returns a new backup progress reporter.
func (*Backup) CompleteBlob ¶
CompleteBlob is called for all saved blobs for files.
func (*Backup) CompleteItem ¶
func (b *Backup) 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 (*Backup) Error ¶
Error is the error callback function for the archiver, it prints the error and returns nil.
func (*Backup) ReportTotal ¶
ReportTotal sets the total stats up to now
func (*Backup) Run ¶
Run regularly updates the status lines. It should be called in a separate goroutine.
func (*Backup) ScannerError ¶
ScannerError is the error callback function for the scanner, it prints the error in verbose mode and returns nil.
func (*Backup) SetMinUpdatePause ¶
SetMinUpdatePause sets b.MinUpdatePause. It satisfies the ArchiveProgressReporter interface.