package models import ( "time" ) // FileInfo represents a file in the backup system type FileInfo struct { Path string MTime time.Time Size int64 } // ChunkInfo represents a content-addressed chunk type ChunkInfo struct { Hash string // SHA256 hash Size int64 Offset int64 // Offset within source file } // ChunkRef represents a reference to a chunk in a blob or file type ChunkRef struct { ChunkHash string Offset int64 Length int64 } // BlobInfo represents an encrypted blob containing multiple chunks type BlobInfo struct { Hash string // SHA256 hash of the blob content (content-addressable) CreatedAt time.Time Size int64 ChunkCount int } // Snapshot represents a backup snapshot type Snapshot struct { ID string // ISO8601 timestamp Hostname string Version string CreatedAt time.Time FileCount int64 ChunkCount int64 BlobCount int64 TotalSize int64 MetadataSize int64 } // SnapshotMetadata contains the full metadata for a snapshot type SnapshotMetadata struct { Snapshot *Snapshot Files map[string]*FileInfo Chunks map[string]*ChunkInfo Blobs map[string]*BlobInfo FileChunks map[string][]*ChunkRef // path -> chunks BlobChunks map[string][]*ChunkRef // blob hash -> chunks } // Chunk represents a data chunk for processing type Chunk struct { Data []byte Hash string Offset int64 Length int64 } // DirtyPath represents a path marked for backup by inotify type DirtyPath struct { Path string MarkedAt time.Time EventType string // "create", "modify", "delete" }