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) Enabled() bool
- func (p *Progress) Error(path string, err error, isIgnored bool)
- func (p *Progress) EstimatedDataSize(fileCount int64, totalBytes int64)
- func (p *Progress) EstimationParameters() snapshotfs.EstimationParameters
- 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) 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"
const MaxErrorReported = 10
const UploaderConfigMultipartKey = "uploader-multipart"
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
GetKopiaManifestEntry 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 ¶
type BlockOutput struct { *restore.FilesystemOutput // contains filtered or unexported fields }
func (*BlockOutput) BeginDirectory ¶
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress represents a backup or restore counters.
func NewProgress ¶
func NewProgress(updater uploader.ProgressUpdater, interval time.Duration, log logrus.FieldLogger) *Progress
func (*Progress) CachedFile ¶
CachedFile statistic the total bytes been cached currently
func (*Progress) EstimatedDataSize ¶
EstimatedDataSize statistic the total size of files to be processed and total files to be processed
func (*Progress) EstimationParameters ¶
func (p *Progress) EstimationParameters() snapshotfs.EstimationParameters
func (*Progress) ExcludedDir ¶
ExcludedDir statistic the dir been excluded currently
func (*Progress) ExcludedFile ¶
ExcludedFile statistic the file been excluded currently
func (*Progress) FinishedDirectory ¶
FinishedDirectory called when finish to upload one directory
func (*Progress) FinishedFile ¶
func (*Progress) FinishedHashingFile ¶
FinishedHashingFile which will called when specific file finished hash
func (*Progress) HashedBytes ¶
HashedBytes statistic the total bytes been hashed currently
func (*Progress) HashingFile ¶
HashingFile statistic the file been hashed currently
func (*Progress) ProgressBytes ¶
ProgressBytes which statistic all bytes has been processed currently
func (*Progress) StartedDirectory ¶
StartedDirectory called when begin to upload one directory
func (*Progress) UpdateProgress ¶
func (p *Progress) UpdateProgress()
UpdateProgress which calls Updater UpdateProgress interface, update progress by third-party implementation
func (*Progress) UploadFinished ¶
func (p *Progress) UploadFinished()
UploadFinished which report the files flushed after the Upload has completed.
func (*Progress) UploadStarted ¶
func (p *Progress) UploadStarted()
UploadStarted statistic the total Error has occurred
func (*Progress) UploadedBytes ¶
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