Documentation
¶
Index ¶
- type CheckResult
- type Checker
- func (c *Checker) CheckDirectories() CheckResult
- func (c *Checker) CheckDiskSpace() CheckResult
- func (c *Checker) CheckDiskSpaceForEstimate(estimatedSizeGB float64) CheckResult
- func (c *Checker) CheckLockFile() CheckResult
- func (c *Checker) CheckPermissions() CheckResult
- func (c *Checker) DisableCloud()
- func (c *Checker) ReleaseLock() error
- func (c *Checker) RunAllChecks(ctx context.Context) ([]CheckResult, error)
- type CheckerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckResult ¶
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) 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 ¶
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
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