restore

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemAction added in v0.17.0

type ItemAction string
const (
	ActionDirRestored   ItemAction = "dir restored"
	ActionFileRestored  ItemAction = "file restored"
	ActionFileUpdated   ItemAction = "file updated"
	ActionFileUnchanged ItemAction = "file unchanged"
	ActionOtherRestored ItemAction = "other restored"
	ActionDeleted       ItemAction = "deleted"
)

Constants for the different CompleteItem actions.

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(printer ProgressPrinter, interval time.Duration) *Progress

func (*Progress) AddFile

func (p *Progress) AddFile(size uint64)

AddFile starts tracking a new file with the given size

func (*Progress) AddProgress

func (p *Progress) AddProgress(name string, action ItemAction, bytesWrittenPortion uint64, bytesTotal uint64)

AddProgress accumulates the number of bytes written for a file

func (*Progress) AddSkippedFile added in v0.17.0

func (p *Progress) AddSkippedFile(name string, size uint64)

func (*Progress) Error added in v0.17.1

func (p *Progress) Error(item string, err error) error

func (*Progress) Finish

func (p *Progress) Finish()

func (*Progress) ReportDeletion added in v0.18.0

func (p *Progress) ReportDeletion(name string)

type ProgressPrinter

type ProgressPrinter interface {
	Update(progress State, duration time.Duration)
	Error(item string, err error) error
	CompleteItem(action ItemAction, item string, size uint64)
	Finish(progress State, duration time.Duration)
}

func NewJSONProgress

func NewJSONProgress(terminal ui.Terminal, verbosity uint) ProgressPrinter

func NewTextProgress

func NewTextProgress(terminal ui.Terminal, verbosity uint) ProgressPrinter

type State added in v0.17.0

type State struct {
	FilesFinished   uint64
	FilesTotal      uint64
	FilesSkipped    uint64
	FilesDeleted    uint64
	AllBytesWritten uint64
	AllBytesTotal   uint64
	AllBytesSkipped uint64
}

Jump to

Keyboard shortcuts

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