Documentation ¶
Overview ¶
Package storage keeps logic for volumes and snapshots info repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GarbageRepo ¶
type GarbageRepo struct {
// contains filtered or unexported fields
}
GarbageRepo keeps paths to old subvolumes after restore operation. Usually path looks like path.Join(domain.DeloreanMountPoint, fmt.Sprintf("%s.old", vol.Subvol)). We can remove old subvolume after reboot only. The solution is to keep path in storage and remove on the next application run after reboot. This logic works only with force reboot.
func NewGarbageRepo ¶
func NewGarbageRepo(db *bolt.DB) (*GarbageRepo, error)
NewGarbageRepo creates a new snapshot repository.
func (*GarbageRepo) Delete ¶
func (r *GarbageRepo) Delete(ph string) error
Delete path from database.
func (*GarbageRepo) List ¶
func (r *GarbageRepo) List() ([]string, error)
List returns the list paths to old file systems.
func (*GarbageRepo) Put ¶
func (r *GarbageRepo) Put(ph string) error
Put saves a path for old file system to data storage.
type SnapshotRepo ¶
type SnapshotRepo struct {
// contains filtered or unexported fields
}
SnapshotRepo is a repository for snapshots.
func NewSnapshotRepo ¶
func NewSnapshotRepo(db *bolt.DB) (*SnapshotRepo, error)
NewSnapshotRepo creates a new snapshot repository.
func (*SnapshotRepo) Delete ¶
func (r *SnapshotRepo) Delete(ph string) error
Delete removes snapshot info record by path.
type VolumeRepo ¶
type VolumeRepo struct {
// contains filtered or unexported fields
}
VolumeRepo is repository for subvolumes.
func NewVolumeRepo ¶
func NewVolumeRepo(db *bolt.DB) *VolumeRepo
NewVolumeRepo creates a new VolumeRepo.
func (*VolumeRepo) Get ¶
func (r *VolumeRepo) Get(id uint64) (domain.Volume, error)
Get returns volume by id if exists or error.