Documentation
¶
Overview ¶
Package cli provides the command-line interface with injectable io.Writer for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupService ¶
type BackupService interface {
BackupProject(cfg *config.Config, project string) backup.BackupResult
RunBackup(cfg *config.Config) ([]backup.BackupResult, error)
}
BackupService provides backup operations for the CLI.
type CLI ¶
type CLI struct {
Out io.Writer // Standard output
Err io.Writer // Standard error
Version string // Application version
Args []string // Command arguments (like os.Args)
// Exit function for testability (defaults to os.Exit)
Exit func(code int)
// Injectable dependencies (nil means use defaults)
ConfigSvc ConfigService
BackupSvc BackupService
RecoverySvc RecoveryService
LaunchdSvc LaunchdService
// contains filtered or unexported fields
}
CLI represents the command-line interface with injectable dependencies.
func NewForTesting ¶
NewForTesting creates a CLI configured for testing (no colors, captured output).
func (*CLI) InstallLaunchd ¶
func (c *CLI) InstallLaunchd()
InstallLaunchd installs the launchd schedule.
func (*CLI) MoveBackups ¶ added in v1.0.0
func (c *CLI) MoveBackups()
MoveBackups moves all backups to a new location and updates the config.
func (*CLI) UninstallLaunchd ¶
func (c *CLI) UninstallLaunchd()
UninstallLaunchd removes the launchd schedule.
type ConfigService ¶
type ConfigService interface {
Load() (*config.Config, error)
Save(cfg *config.Config) error
ConfigPath() (string, error)
DefaultConfig() (*config.Config, error)
}
ConfigService provides configuration operations for the CLI.
type LaunchdService ¶
type LaunchdService interface {
IsInstalled() bool
Install(hour, minute int) error
Uninstall() error
Status() (bool, error)
PlistPath() string
LogPath() string
}
LaunchdService provides launchd operations for the CLI.
type RecoveryService ¶
type RecoveryService interface {
Verify(cfg *config.Config, project, version string) error
Recover(cfg *config.Config, opts recovery.RecoverOptions) error
ListVersions(cfg *config.Config, project string) ([]manifest.BackupEntry, error)
}
RecoveryService provides recovery operations for the CLI.