Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBinaryContent ¶
IsBinaryContent checks if content appears to be binary
func ReadZipFile ¶
ReadZipFile extracts the contents of a file from a zip archive
Types ¶
type DiffLine ¶
type DiffLine struct {
LineNum1 int // Line number in version 1 (0 if added)
LineNum2 int // Line number in version 2 (0 if deleted)
Type rune // '+' added, '-' deleted, ' ' unchanged
Content string // Line content
}
DiffLine represents a single line in the diff output
type DiffResult ¶
type DiffResult struct {
Version1 string
Version2 string
Changes []FileChange
Added int
Modified int
Deleted int
}
DiffResult contains the comparison between two backup versions
func ComputeDiff ¶
func ComputeDiff(cfg *config.Config, project, version1, version2 string) (*DiffResult, error)
ComputeDiff compares two backup versions and returns the differences
type FileChange ¶
type FileChange struct {
Path string
Status rune // 'M' modified, 'A' added, 'D' deleted
Size1 int64
Size2 int64
}
FileChange represents a change between two versions
type FileDiffResult ¶
type FileDiffResult struct {
Path string
Version1 string
Version2 string
Lines []DiffLine
IsBinary bool
Error string
}
FileDiffResult contains the line-by-line diff of a single file
func ComputeFileDiff ¶
func ComputeFileDiff(cfg *config.Config, project, version1, version2, filePath string, status rune) (*FileDiffResult, error)
ComputeFileDiff computes the line-by-line diff between two versions of a file
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main TUI model
func NewModelWithConfig ¶
func NewModelWithConfig(cfg *config.Config, svc ports.TUIService) *Model
NewModelWithConfig creates a new TUI model with a provided config and service. This is useful for testing with pre-configured state.
func NewModelWithService ¶
func NewModelWithService(version string, svc ports.TUIService) (*Model, error)
NewModelWithService creates a new TUI model with a custom service. This allows dependency injection for testing.
type ProjectItem ¶
type ProjectItem struct {
Name string
Path string
SourceLabel string
SourceIcon string
SourceType string // "git" or "sensitive"
Versions int
LastBackup time.Time
TotalSize int64
}
ProjectItem represents a project in the list
type SnapshotItem ¶ added in v1.0.0
SnapshotItem represents a restic snapshot in the list
type VersionItem ¶
VersionItem represents a backup version
type View ¶
type View int
View represents the current view state
const ( ProjectsView View = iota VersionsView SnapshotsView // View for restic snapshots (sensitive sources) DiffSelectView // Selecting versions to compare DiffResultView // Showing diff results (file list) FileDiffView // Showing actual file content diff SettingsView // Settings/configuration view MoveInputView // Folder picker for move path MoveConfirmView // Confirmation before moving )