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() upload.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) GetIncrementalSize() 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 RestoreOutput
- 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 ¶ added in v1.12.1
type BlockOutput struct {
*restore.FilesystemOutput
// contains filtered or unexported fields
}
func (*BlockOutput) BeginDirectory ¶ added in v1.12.1
func (*BlockOutput) Flush ¶ added in v1.18.1
func (o *BlockOutput) Flush() error
func (*BlockOutput) Terminate ¶ added in v1.18.1
func (o *BlockOutput) Terminate() error
type Progress ¶ added in v1.12.0
type Progress struct {
// contains filtered or unexported fields
}
Progress represents a backup or restore counters.
func NewProgress ¶ added in v1.16.0
func NewProgress(updater uploader.ProgressUpdater, interval time.Duration, log logrus.FieldLogger) *Progress
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) EstimationParameters ¶ added in v1.16.0
func (p *Progress) EstimationParameters() upload.EstimationParameters
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) GetIncrementalSize ¶ added in v1.18.0
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) 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 RestoreOutput ¶ added in v1.18.1
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