restore

package
v0.0.0-...-0265167 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 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

type ItemAction string
const (
	ActionDirRestored   ItemAction = "dir restored"
	ActionFileRestored  ItemAction = "file restored"
	ActionFileUpdated   ItemAction = "file updated"
	ActionFileUnchanged ItemAction = "file unchanged"
	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

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

func (*Progress) Finish

func (p *Progress) Finish()

func (*Progress) ReportDeletedFile

func (p *Progress) ReportDeletedFile(name string)

type ProgressPrinter

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

func NewJSONProgress

func NewJSONProgress(terminal term, verbosity uint) ProgressPrinter

func NewTextProgress

func NewTextProgress(terminal term, verbosity uint) ProgressPrinter

type State

type State struct {
	FilesFinished   uint64
	FilesTotal      uint64
	FilesSkipped    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