checks

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Name    string
	Passed  bool
	Message string
	Error   error
	Code    string
}

CheckResult holds the result of a validation check

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker performs pre-backup validation checks

func NewChecker

func NewChecker(logger *logging.Logger, config *CheckerConfig) *Checker

NewChecker creates a new pre-backup checker

func (*Checker) CheckDirectories

func (c *Checker) CheckDirectories() CheckResult

CheckDirectories verifies required directories exist

func (*Checker) CheckDiskSpace

func (c *Checker) CheckDiskSpace() CheckResult

CheckDiskSpace verifies sufficient disk space is available

func (*Checker) CheckDiskSpaceForEstimate

func (c *Checker) CheckDiskSpaceForEstimate(estimatedSizeGB float64) CheckResult

CheckDiskSpaceForEstimate checks if there's enough space for an estimated backup size

func (*Checker) CheckLockFile

func (c *Checker) CheckLockFile() CheckResult

CheckLockFile checks for stale lock files and creates a new lock

func (*Checker) CheckPermissions

func (c *Checker) CheckPermissions() CheckResult

CheckPermissions verifies write permissions on required directories

func (*Checker) CheckTempDirectory added in v0.12.4

func (c *Checker) CheckTempDirectory() CheckResult

CheckTempDirectory verifies /tmp/proxsave exists, is writable, and supports symlinks

func (*Checker) DisableCloud

func (c *Checker) DisableCloud()

DisableCloud globally disables cloud-related checks for this checker. It is used when the Go pipeline determines that cloud storage is unavailable and should be treated as disabled for the rest of the run.

func (*Checker) ReleaseLock

func (c *Checker) ReleaseLock() error

ReleaseLock removes the lock file

func (*Checker) RunAllChecks

func (c *Checker) RunAllChecks(ctx context.Context) ([]CheckResult, error)

RunAllChecks performs all pre-backup validation checks Order is important: directories must exist before we can check disk space, permissions, or create lock files in those directories

func (*Checker) ShouldSkipPermissionCheck added in v0.12.4

func (c *Checker) ShouldSkipPermissionCheck() bool

ShouldSkipPermissionCheck returns true if permission checks should be skipped

type CheckerConfig

type CheckerConfig struct {
	BackupPath          string
	LogPath             string
	SecondaryPath       string
	SecondaryEnabled    bool
	CloudPath           string
	CloudEnabled        bool
	MinDiskPrimaryGB    float64
	MinDiskSecondaryGB  float64
	MinDiskCloudGB      float64
	SafetyFactor        float64 // Multiplier for estimated size (e.g., 1.5 = 50% buffer)
	LockDirPath         string
	LockFilePath        string
	MaxLockAge          time.Duration
	SkipPermissionCheck bool
	DryRun              bool
}

CheckerConfig holds configuration for pre-backup checks

func GetDefaultCheckerConfig

func GetDefaultCheckerConfig(backupPath, logPath, lockDir string) *CheckerConfig

GetDefaultCheckerConfig returns a default checker configuration

func (*CheckerConfig) Validate

func (c *CheckerConfig) Validate() error

Validate checks if the checker configuration is valid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL