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)
- type Message
- type StdioWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct { *Message *StdioWrapper MinUpdatePause time.Duration // contains filtered or unexported fields }
Backup reports progress for the `backup` command.
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
SetMinUpdatePause sets b.MinUpdatePause. It satisfies the ArchiveProgressReporter interface.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message reports progress with messages of different verbosity.
func NewMessage ¶
func NewMessage(term *termstatus.Terminal, verbosity uint) *Message
NewMessage returns a message progress reporter with underlying terminal term.
func (*Message) P ¶
P prints a message if verbosity >= 1, this is used for normal messages which are not errors.
type StdioWrapper ¶
type StdioWrapper struct {
// contains filtered or unexported fields
}
StdioWrapper provides stdout and stderr integration with termstatus.
func NewStdioWrapper ¶
func NewStdioWrapper(term *termstatus.Terminal) *StdioWrapper
NewStdioWrapper initializes a new stdio wrapper that can be used in place of os.Stdout or os.Stderr.
func (*StdioWrapper) Stderr ¶
func (w *StdioWrapper) Stderr() io.WriteCloser
Stderr returns a writer that is line buffered and can be used in place of os.Stderr. On Close(), the remaining bytes are written, followed by a line break.
func (*StdioWrapper) Stdout ¶
func (w *StdioWrapper) Stdout() io.WriteCloser
Stdout returns a writer that is line buffered and can be used in place of os.Stdout. On Close(), the remaining bytes are written, followed by a line break.