kopia

package
v1.11.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup

func Backup(ctx context.Context, fsUploader *snapshotfs.Uploader, repoWriter repo.RepositoryWriter, sourcePath string,
	parentSnapshot string, log logrus.FieldLogger) (*uploader.SnapshotInfo, bool, error)

Backup backup specific sourcePath and update progress

func GetKopiaManifestEntries

func GetKopiaManifestEntries(uMani []*udmrepo.ManifestEntryMetadata) []*manifest.EntryMetadata

GetKopiaManifestEntries get metadata list from specific ManifestEntryMetadata

func GetKopiaManifestEntry

func GetKopiaManifestEntry(uMani *udmrepo.ManifestEntryMetadata) *manifest.EntryMetadata

GetKopiaManifestEntries get metadata from specific ManifestEntryMetadata

func NewShimRepo

func NewShimRepo(repo udmrepo.BackupRepo) repo.RepositoryWriter

func Restore

func Restore(ctx context.Context, rep repo.RepositoryWriter, progress *KopiaProgress, snapshotID, dest string, log logrus.FieldLogger, cancleCh chan struct{}) (int64, int32, error)

Restore restore specific sourcePath with given snapshotID and update progress

func SnapshotSource

func SnapshotSource(
	ctx context.Context,
	rep repo.RepositoryWriter,
	u SnapshotUploader,
	sourceInfo snapshot.SourceInfo,
	rootDir fs.Entry,
	parentSnapshot string,
	log logrus.FieldLogger,
	description string,
) (string, int64, error)

SnapshotSource which setup policy for snapshot, upload snapshot, update progress

Types

type KopiaProgress

type KopiaProgress struct {
	Updater uploader.ProgressUpdater //which kopia progress will call the UpdateProgress interface, the third party will implement the interface to do the progress update
	Log     logrus.FieldLogger       // output info into log when backup
	// contains filtered or unexported fields
}

KopiaProgress represents a backup or restore counters.

func (*KopiaProgress) CachedFile

func (p *KopiaProgress) CachedFile(fname string, numBytes int64)

CachedFile statistic the total bytes been cached currently

func (*KopiaProgress) Error

func (p *KopiaProgress) Error(path string, err error, isIgnored bool)

Error statistic the total Error has occurred

func (*KopiaProgress) EstimatedDataSize

func (p *KopiaProgress) EstimatedDataSize(fileCount int, totalBytes int64)

EstimatedDataSize statistic the total size of files to be processed and total files to be processed

func (*KopiaProgress) ExcludedDir

func (p *KopiaProgress) ExcludedDir(dirname string)

ExcludedDir statistic the dir been excluded currently

func (*KopiaProgress) ExcludedFile

func (p *KopiaProgress) ExcludedFile(fname string, numBytes int64)

ExcludedFile statistic the file been excluded currently

func (*KopiaProgress) FinishedDirectory

func (p *KopiaProgress) FinishedDirectory(dirname string)

FinishedDirectory called when finish to upload one directory

func (*KopiaProgress) FinishedHashingFile

func (p *KopiaProgress) FinishedHashingFile(fname string, numBytes int64)

FinishedHashingFile which will called when specific file finished hash

func (*KopiaProgress) HashedBytes

func (p *KopiaProgress) HashedBytes(numBytes int64)

HashedBytes statistic the total bytes been hashed currently

func (*KopiaProgress) HashingFile

func (p *KopiaProgress) HashingFile(fname string)

HashingFile statistic the file been hashed currently

func (*KopiaProgress) InitThrottle

func (p *KopiaProgress) InitThrottle(interval time.Duration)

func (*KopiaProgress) ProgressBytes

func (p *KopiaProgress) ProgressBytes(processedBytes int64, totalBytes int64)

ProgressBytes which statistic all bytes has been processed currently

func (*KopiaProgress) StartedDirectory

func (p *KopiaProgress) StartedDirectory(dirname string)

StartedDirectory called when begin to upload one directory

func (*KopiaProgress) UpdateProgress

func (p *KopiaProgress) UpdateProgress()

UpdateProgress which calls Updater UpdateProgress interface, update progress by third-party implementation

func (*KopiaProgress) UploadFinished

func (p *KopiaProgress) UploadFinished()

UploadFinished which report the files flushed after the Upload has completed.

func (*KopiaProgress) UploadStarted

func (p *KopiaProgress) UploadStarted()

UploadStarted statistic the total Error has occurred

func (*KopiaProgress) UploadedBytes

func (p *KopiaProgress) UploadedBytes(numBytes int64)

UploadedBytes the total bytes has uploaded currently

type SnapshotUploader

type SnapshotUploader interface {
	Upload(
		ctx context.Context,
		source fs.Entry,
		policyTree *policy.Tree,
		sourceInfo snapshot.SourceInfo,
		previousManifests ...*snapshot.Manifest,
	) (*snapshot.Manifest, error)
}

SnapshotUploader which mainly used for UT test that could overwrite Upload interface

type Throttle

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

Throttle throttles controlle the interval of output result

func (*Throttle) ShouldOutput

func (t *Throttle) ShouldOutput() bool

Jump to

Keyboard shortcuts

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