package database import "time" // File represents a file record in the database type File struct { Path string MTime time.Time CTime time.Time Size int64 Mode uint32 UID uint32 GID uint32 LinkTarget string // empty for regular files, target path for symlinks } // IsSymlink returns true if this file is a symbolic link func (f *File) IsSymlink() bool { return f.LinkTarget != "" } // FileChunk represents the mapping between files and chunks type FileChunk struct { Path string Idx int ChunkHash string } // Chunk represents a chunk record in the database type Chunk struct { ChunkHash string SHA256 string Size int64 } // Blob represents a blob record in the database type Blob struct { BlobHash string CreatedTS time.Time } // BlobChunk represents the mapping between blobs and chunks type BlobChunk struct { BlobHash string ChunkHash string Offset int64 Length int64 } // ChunkFile represents the reverse mapping of chunks to files type ChunkFile struct { ChunkHash string FilePath string FileOffset int64 Length int64 } // Snapshot represents a snapshot record in the database type Snapshot struct { ID string Hostname string VaultikVersion string CreatedTS time.Time FileCount int64 ChunkCount int64 BlobCount int64 }