json

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2020 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

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

func (b *Backup) CompleteBlob(filename string, bytes uint64)

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

func (b *Backup) Error(item string, fi os.FileInfo, err error) error

Error is the error callback function for the archiver, it prints the error and returns nil.

func (*Backup) Finish

func (b *Backup) Finish(snapshotID restic.ID)

Finish prints the finishing messages.

func (*Backup) ReportTotal

func (b *Backup) ReportTotal(item string, s archiver.ScanStats)

ReportTotal sets the total stats up to now

func (*Backup) Run

func (b *Backup) Run(ctx context.Context) error

Run regularly updates the status lines. It should be called in a separate goroutine.

func (*Backup) ScannerError

func (b *Backup) ScannerError(item string, fi os.FileInfo, err error) error

ScannerError is the error callback function for the scanner, it prints the error in verbose mode and returns nil.

func (*Backup) SetMinUpdatePause

func (b *Backup) SetMinUpdatePause(d time.Duration)

SetMinUpdatePause sets b.MinUpdatePause. It satisfies the ArchiveProgressReporter interface.

func (*Backup) StartFile

func (b *Backup) StartFile(filename string)

StartFile is called when a file is being processed by a worker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL