Documentation ¶
Index ¶
- func CheckIfEnoughSpaceToBackUp(storage string) error
- func CheckIfEnoughSpaceToRestore(backupPath string) error
- func GenerateUniqueTempPath(path string) (string, error)
- func GetAvailableDiskSpace(path string) (uint64, error)
- func GetSizeOfDir(path string) (uint64, error)
- func GetSizeOfMicroShiftData() (uint64, error)
- func NewManager(storage StoragePath) (*manager, error)
- type AtomicDirCopy
- type BackupName
- type EmptyArgErr
- type Manager
- type StoragePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfEnoughSpaceToBackUp ¶
CheckIfEnoughSpaceToBackUp performs a naive check if there is enough disk space on a filesystem holding the backups for another backup of MicroShift data. It does not accommodate for potential Copy-on-Write disk savings.
func CheckIfEnoughSpaceToRestore ¶
CheckIfEnoughSpaceToRestore performs a naive check if there is enough disk space on /var/lib filesystem to restore the backup. It does not accommodate for potential Copy-on-Write disk savings.
func GenerateUniqueTempPath ¶
GenerateUniqueTempPath returns a filepath from given path with extra suffix which doesn't exist.
func GetAvailableDiskSpace ¶
func GetSizeOfDir ¶
func GetSizeOfMicroShiftData ¶
func NewManager ¶
func NewManager(storage StoragePath) (*manager, error)
Types ¶
type AtomicDirCopy ¶
type AtomicDirCopy struct { Source string Destination string // contains filtered or unexported fields }
AtomicDirCopy atomically copies directory. It performs a two operation: copies source path to a destination location with temporary name, then renames it to final name. On Unix systems, the rename operation is atomic. This ensures that the file is either fully renamed or not at all, which helps prevent issues like partial file copies in cases of power failure or unexpected program termination.
func (*AtomicDirCopy) CopyToIntermediate ¶
func (c *AtomicDirCopy) CopyToIntermediate() error
func (*AtomicDirCopy) RenameToFinal ¶
func (c *AtomicDirCopy) RenameToFinal() error
func (*AtomicDirCopy) RollbackIntermediate ¶
func (c *AtomicDirCopy) RollbackIntermediate() error
type BackupName ¶
type BackupName string
type EmptyArgErr ¶
type EmptyArgErr struct {
// contains filtered or unexported fields
}
func (*EmptyArgErr) Error ¶
func (e *EmptyArgErr) Error() string
type Manager ¶
type Manager interface { Backup(BackupName) (string, error) Restore(BackupName) error BackupExists(BackupName) (bool, error) GetBackupPath(BackupName) string GetBackupList() ([]BackupName, error) RemoveBackup(BackupName) error RemoveData() error }
type StoragePath ¶
type StoragePath string
func (StoragePath) GetBackupPath ¶
func (sp StoragePath) GetBackupPath(backupName BackupName) string
func (StoragePath) SubStorage ¶
func (sp StoragePath) SubStorage(subdir string) StoragePath