Documentation ¶
Overview ¶
Package blobmanipulator provides the framework for snapshot fix testing.
Index ¶
- type BlobManipulator
- func (bm *BlobManipulator) ConnectOrCreateRepo(dataRepoPath string) error
- func (bm *BlobManipulator) DeleteBlob(blobID string) error
- func (bm *BlobManipulator) DeleteSnapshot(snapshotID string) (string, error)
- func (bm *BlobManipulator) RestoreGivenOrRandomSnapshot(snapID, restoreDir string) (string, error)
- func (bm *BlobManipulator) RunMaintenance() (string, error)
- func (bm *BlobManipulator) SetUpSystemUnderTest() error
- func (bm *BlobManipulator) SnapshotFixInvalidFiles(flags string) (string, error)
- func (bm *BlobManipulator) SnapshotFixRemoveFilesByBlobID(blobID string) (string, error)
- func (bm *BlobManipulator) SnapshotFixRemoveFilesByFilename(filename string) (string, error)
- func (bm *BlobManipulator) TakeSnapshot(dir string) (snapID, stdout string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobManipulator ¶
type BlobManipulator struct { KopiaCommandRunner *kopiarunner.KopiaSnapshotter DirCreater *snapmeta.KopiaSnapshotter DataRepoPath string CanRunMaintenance bool PathToTakeSnapshot string // contains filtered or unexported fields }
BlobManipulator provides a way to run a kopia command.
func NewBlobManipulator ¶
func NewBlobManipulator(baseDirPath, dataRepoPath string) (*BlobManipulator, error)
NewBlobManipulator instantiates a new BlobManipulator and returns its pointer.
func (*BlobManipulator) ConnectOrCreateRepo ¶
func (bm *BlobManipulator) ConnectOrCreateRepo(dataRepoPath string) error
ConnectOrCreateRepo connects to an existing repository if possible or creates a new one.
func (*BlobManipulator) DeleteBlob ¶
func (bm *BlobManipulator) DeleteBlob(blobID string) error
DeleteBlob deletes the provided blob or a random blob, in kopia repo.
func (*BlobManipulator) DeleteSnapshot ¶
func (bm *BlobManipulator) DeleteSnapshot(snapshotID string) (string, error)
DeleteSnapshot deletes provided snapshot.
func (*BlobManipulator) RestoreGivenOrRandomSnapshot ¶
func (bm *BlobManipulator) RestoreGivenOrRandomSnapshot(snapID, restoreDir string) (string, error)
RestoreGivenOrRandomSnapshot restores a given or a random snapshot from kopia repository into the provided target directory.
func (*BlobManipulator) RunMaintenance ¶
func (bm *BlobManipulator) RunMaintenance() (string, error)
RunMaintenance runs repository maintenance.
func (*BlobManipulator) SetUpSystemUnderTest ¶
func (bm *BlobManipulator) SetUpSystemUnderTest() error
SetUpSystemUnderTest connects or creates a kopia repo, writes random data in source directory, creates snapshots of the source directory.
func (*BlobManipulator) SnapshotFixInvalidFiles ¶
func (bm *BlobManipulator) SnapshotFixInvalidFiles(flags string) (string, error)
SnapshotFixInvalidFiles runs snapshot fix invalid-files command with the provided flags.
func (*BlobManipulator) SnapshotFixRemoveFilesByBlobID ¶
func (bm *BlobManipulator) SnapshotFixRemoveFilesByBlobID(blobID string) (string, error)
SnapshotFixRemoveFilesByBlobID runs snapshot fix remove-files command with a provided blob id.
func (*BlobManipulator) SnapshotFixRemoveFilesByFilename ¶
func (bm *BlobManipulator) SnapshotFixRemoveFilesByFilename(filename string) (string, error)
SnapshotFixRemoveFilesByFilename runs snapshot fix remove-files command with a provided file name.
func (*BlobManipulator) TakeSnapshot ¶
func (bm *BlobManipulator) TakeSnapshot(dir string) (snapID, stdout string, err error)
TakeSnapshot creates snapshot of the provided directory.