Documentation
¶
Overview ¶
Package backup provides backup and restore functionality for XxSql.
Index ¶
Constants ¶
View Source
const ( // BackupVersion is the current backup format version. BackupVersion = "1.0" // BackupExt is the extension for backup files. BackupExt = ".xbak" )
Variables ¶
This section is empty.
Functions ¶
func ListBackups ¶
ListBackups lists all backup files in a directory.
Types ¶
type BackupOptions ¶
type BackupOptions struct {
Path string
Compress bool
Database string
TableNames []string // empty means all tables
}
BackupOptions holds options for backup operations.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles backup and restore operations.
func (*Manager) Backup ¶
func (m *Manager) Backup(opts BackupOptions) (*Manifest, error)
Backup creates a full backup of the database.
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
Timestamp string `json:"timestamp"`
Database string `json:"database"`
TableCount int `json:"table_count"`
Tables []TableManifest `json:"tables"`
Checksum string `json:"checksum"`
Compressed bool `json:"compressed"`
TotalSize int64 `json:"total_size"`
}
Manifest represents the backup manifest.
type RestoreOptions ¶
type RestoreOptions struct {
Path string
}
RestoreOptions holds options for restore operations.
Click to show internal directories.
Click to hide internal directories.