backup

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupData

type BackupData struct {
	Passwords []keyring.Entry `json:"passwords"`
	Metadata  BackupMetadata  `json:"metadata"`
}

BackupData represents the structure of a backup file

type BackupInfo

type BackupInfo struct {
	Name    string    `json:"name"`
	Path    string    `json:"path"`
	Size    int64     `json:"size"`
	ModTime time.Time `json:"mod_time"`
}

BackupInfo contains information about a backup file

type BackupMetadata

type BackupMetadata struct {
	BackupDate    time.Time `json:"backup_date"`
	Hostname      string    `json:"hostname"`
	User          string    `json:"user"`
	Version       string    `json:"version"`
	PasswordCount int       `json:"password_count"`
	Checksum      string    `json:"checksum"`
}

BackupMetadata contains information about the backup

type BackupOptions

type BackupOptions struct {
	OutputPath  string
	UseGPG      bool
	UsePassword bool
	BackupDir   string
	MaxBackups  int
}

BackupOptions contains options for backup operations

type Manager

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

Manager handles backup and restore operations

func New

New creates a new backup manager

func (*Manager) CleanOldBackups

func (m *Manager) CleanOldBackups() error

CleanOldBackups removes old backup files, keeping only the most recent ones

func (*Manager) CreateBackup

func (m *Manager) CreateBackup() (string, error)

CreateBackup creates a new backup of all passwords

func (*Manager) ListBackups

func (m *Manager) ListBackups() ([]BackupInfo, error)

ListBackups lists available backup files

func (*Manager) RestoreBackup

func (m *Manager) RestoreBackup(backupPath string) error

RestoreBackup restores passwords from a backup file

func (*Manager) VerifyBackup

func (m *Manager) VerifyBackup(backupPath string) error

VerifyBackup verifies the integrity of a backup file

Jump to

Keyboard shortcuts

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