Documentation ¶
Index ¶
- Constants
- func Backup(ctx context.Context, fsUploader SnapshotUploader, ...) (*uploader.SnapshotInfo, bool, error)
- func GetKopiaManifestEntries(uMani []*udmrepo.ManifestEntryMetadata) []*manifest.EntryMetadata
- func GetKopiaManifestEntry(uMani *udmrepo.ManifestEntryMetadata) *manifest.EntryMetadata
- func NewShimRepo(repo udmrepo.BackupRepo) repo.RepositoryWriter
- func Restore(ctx context.Context, rep repo.RepositoryWriter, progress *Progress, ...) (int64, int32, error)
- func SnapshotSource(ctx context.Context, rep repo.RepositoryWriter, u SnapshotUploader, ...) (string, int64, error)
- type BlockOutput
- type Progress
- func (p *Progress) CachedFile(fname string, numBytes int64)
- func (p *Progress) Error(path string, err error, isIgnored bool)
- func (p *Progress) EstimatedDataSize(fileCount int, totalBytes int64)
- func (p *Progress) ExcludedDir(dirname string)
- func (p *Progress) ExcludedFile(fname string, numBytes int64)
- func (p *Progress) FinishedDirectory(dirname string)
- func (p *Progress) FinishedFile(fname string, err error)
- func (p *Progress) FinishedHashingFile(fname string, numBytes int64)
- func (p *Progress) HashedBytes(numBytes int64)
- func (p *Progress) HashingFile(fname string)
- func (p *Progress) InitThrottle(interval time.Duration)
- func (p *Progress) ProgressBytes(processedBytes int64, totalBytes int64)
- func (p *Progress) StartedDirectory(dirname string)
- func (p *Progress) UpdateProgress()
- func (p *Progress) UploadFinished()
- func (p *Progress) UploadStarted()
- func (p *Progress) UploadedBytes(numBytes int64)
- type SnapshotUploader
- type Throttle
Constants ¶
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
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
CachedFile statistic the total bytes been cached currently
func (*Progress) EstimatedDataSize ¶ added in v1.12.0
EstimatedDataSize statistic the total size of files to be processed and total files to be processed
func (*Progress) ExcludedDir ¶ added in v1.12.0
ExcludedDir statistic the dir been excluded currently
func (*Progress) ExcludedFile ¶ added in v1.12.0
ExcludedFile statistic the file been excluded currently
func (*Progress) FinishedDirectory ¶ added in v1.12.0
FinishedDirectory called when finish to upload one directory
func (*Progress) FinishedFile ¶ added in v1.12.0
func (*Progress) FinishedHashingFile ¶ added in v1.12.0
FinishedHashingFile which will called when specific file finished hash
func (*Progress) HashedBytes ¶ added in v1.12.0
HashedBytes statistic the total bytes been hashed currently
func (*Progress) HashingFile ¶ added in v1.12.0
HashingFile statistic the file been hashed currently
func (*Progress) InitThrottle ¶ added in v1.12.0
func (*Progress) ProgressBytes ¶ added in v1.12.0
ProgressBytes which statistic all bytes has been processed currently
func (*Progress) StartedDirectory ¶ added in v1.12.0
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
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