kopia

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const ErrNotPermitted = "operation not permitted"

Variables

This section is empty.

Functions

func Backup

func Backup(ctx context.Context, fsUploader SnapshotUploader, repoWriter repo.RepositoryWriter, sourcePath string, realSource string,
	forceFull bool, parentSnapshot string, volMode uploader.PersistentVolumeMode, uploaderCfg map[string]string, tags map[string]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 *Progress, snapshotID, dest string, volMode uploader.PersistentVolumeMode, uploaderCfg map[string]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,
	forceFull bool,
	parentSnapshot string,
	snapshotTags map[string]string,
	uploaderCfg map[string]string,
	log logrus.FieldLogger,
	description string,
) (string, int64, error)

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

Types

type BlockOutput added in v1.12.1

type BlockOutput struct {
	*restore.FilesystemOutput
	// contains filtered or unexported fields
}

func (*BlockOutput) BeginDirectory added in v1.12.1

func (o *BlockOutput) BeginDirectory(ctx context.Context, relativePath string, e fs.Directory) error

func (*BlockOutput) WriteFile added in v1.12.1

func (o *BlockOutput) WriteFile(ctx context.Context, relativePath string, remoteFile fs.File) error

type Progress added in v1.12.0

type Progress 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
}

Progress represents a backup or restore counters.

func (*Progress) CachedFile added in v1.12.0

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

CachedFile statistic the total bytes been cached currently

func (*Progress) Error added in v1.12.0

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

Error statistic the total Error has occurred

func (*Progress) EstimatedDataSize added in v1.12.0

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

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

func (*Progress) ExcludedDir added in v1.12.0

func (p *Progress) ExcludedDir(dirname string)

ExcludedDir statistic the dir been excluded currently

func (*Progress) ExcludedFile added in v1.12.0

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

ExcludedFile statistic the file been excluded currently

func (*Progress) FinishedDirectory added in v1.12.0

func (p *Progress) FinishedDirectory(dirname string)

FinishedDirectory called when finish to upload one directory

func (*Progress) FinishedFile added in v1.12.0

func (p *Progress) FinishedFile(fname string, err error)

func (*Progress) FinishedHashingFile added in v1.12.0

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

FinishedHashingFile which will called when specific file finished hash

func (*Progress) HashedBytes added in v1.12.0

func (p *Progress) HashedBytes(numBytes int64)

HashedBytes statistic the total bytes been hashed currently

func (*Progress) HashingFile added in v1.12.0

func (p *Progress) HashingFile(fname string)

HashingFile statistic the file been hashed currently

func (*Progress) InitThrottle added in v1.12.0

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

func (*Progress) ProgressBytes added in v1.12.0

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

ProgressBytes which statistic all bytes has been processed currently

func (*Progress) StartedDirectory added in v1.12.0

func (p *Progress) StartedDirectory(dirname string)

StartedDirectory called when begin to upload one directory

func (*Progress) UpdateProgress added in v1.12.0

func (p *Progress) UpdateProgress()

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

func (*Progress) UploadFinished added in v1.12.0

func (p *Progress) UploadFinished()

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

func (*Progress) UploadStarted added in v1.12.0

func (p *Progress) UploadStarted()

UploadStarted statistic the total Error has occurred

func (*Progress) UploadedBytes added in v1.12.0

func (p *Progress) 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