backup

package
v0.0.0-...-46646b9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup

type Backup struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Type        string                 `json:"type"`   // "full", "incremental", "differential"
	Status      string                 `json:"status"` // "pending", "running", "completed", "failed"
	CreatedAt   time.Time              `json:"created_at"`
	StartedAt   time.Time              `json:"started_at,omitempty"`
	CompletedAt time.Time              `json:"completed_at,omitempty"`
	Size        int64                  `json:"size"`
	FileCount   int                    `json:"file_count"`
	FilePath    string                 `json:"file_path"`
	Metadata    map[string]interface{} `json:"metadata"`
	Error       string                 `json:"error,omitempty"`
}

Backup represents a backup operation

type BackupConfig

type BackupConfig struct {
	Name        string            `json:"name"`
	Type        string            `json:"type"`
	Schedule    string            `json:"schedule"`  // cron expression
	Retention   int               `json:"retention"` // days
	Compression bool              `json:"compression"`
	Encryption  bool              `json:"encryption"`
	Include     []string          `json:"include"`
	Exclude     []string          `json:"exclude"`
	Destination string            `json:"destination"`
	Options     map[string]string `json:"options"`
}

BackupConfig represents backup configuration

type Manager

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

Manager manages backup and recovery operations

func New

func New(client *client.Client, configDir string) *Manager

New creates a new backup manager

func (*Manager) CleanupOldBackups

func (bm *Manager) CleanupOldBackups(retentionDays int) error

CleanupOldBackups removes old backups based on retention policy

func (*Manager) CreateBackup

func (bm *Manager) CreateBackup(config *BackupConfig) (*Backup, error)

CreateBackup creates a new backup

func (*Manager) DeleteBackup

func (bm *Manager) DeleteBackup(id string) error

DeleteBackup deletes a backup

func (*Manager) GetBackup

func (bm *Manager) GetBackup(id string) (*Backup, error)

GetBackup returns a backup by ID

func (*Manager) ListBackups

func (bm *Manager) ListBackups() []*Backup

ListBackups returns all backups

func (*Manager) ListScheduledBackups

func (bm *Manager) ListScheduledBackups() ([]*BackupConfig, error)

ListScheduledBackups returns all scheduled backups

func (*Manager) RestoreBackup

func (bm *Manager) RestoreBackup(backupID, destination string) error

RestoreBackup restores from a backup

func (*Manager) ScheduleBackup

func (bm *Manager) ScheduleBackup(config *BackupConfig) error

ScheduleBackup schedules a backup

func (*Manager) StartBackup

func (bm *Manager) StartBackup(backupID string, config *BackupConfig) error

StartBackup starts a backup operation

type RestorePoint

type RestorePoint struct {
	ID          string    `json:"id"`
	BackupID    string    `json:"backup_id"`
	Name        string    `json:"name"`
	CreatedAt   time.Time `json:"created_at"`
	Size        int64     `json:"size"`
	FileCount   int       `json:"file_count"`
	Description string    `json:"description"`
}

RestorePoint represents a restore point

Jump to

Keyboard shortcuts

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