From f92155a25313f6cc02b8ac504ef54dbfe2c7515a Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Tue, 19 May 2026 22:34:24 -0600 Subject: [PATCH] after a few rounds with claude, still not done --- internal/storage/local.go | 35 ++++++++++++++++++----------------- internal/storage/storage.go | 28 +++++++++++++++++++++------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/internal/storage/local.go b/internal/storage/local.go index 287dda4..12900de 100644 --- a/internal/storage/local.go +++ b/internal/storage/local.go @@ -1,39 +1,40 @@ package storage -//import () +import ( + "io" + "os" +) -type LocalStorage { - BaseDir string + +type LocalStorage struct { + BaseDir string, } -func UploadFile(dirPath, filename string, data io.Reader) error { + +func (s *LocalStorage) UploadFile(dirPath string, filename string, data io.Reader) error { // } -func ListFiles(dirPath) { +func (s *LocalStorage) ListFiles(dirPath string) ([]FileNode, error) { // } -func ReadFile() { +func (s *LocalStorage) ReadFile(filePath string) (*os.File, error) { // } -func WriteFile() { +func (s *LocalStorage) WriteFile(dirPath string, filename string, data io.Reader) (int, error) { + // this is explicitly for writing text files that aren't being uploaded +} + +func (s *LocalStorage) DeleteFile(filePath string) error { // } -func CloseFile() { +func (s *LocalStorage) DeleteDirectory(dirPath string) error { // } -func DeleteFile() { - // -} - -func DeleteDirectory() { - // -} - -func DeleteDirectoryRecursive() { +func (s *LocalStorage) DeleteDirectoryRecursive(dirPath string) error { // } diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 7bfe734..453f44d 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -1,11 +1,25 @@ package storage + +import ( + "io" + "os" +) + + type Storage interface { - ListFiles() - ReadFile(b []byte) (n int, err error) - WriteFile(b []byte) (n int, err error) - CloseFile() error - DeleteFile() - DeleteDirectory() - DeleteDirectoryRecursive() + UploadFile(dirPath string, filename string, data io.Reader) error + ListFiles(dirPath string) ([]FileNode, error) + ReadFile(filePath string) (*os.File, error) + WriteFile(dirPath string, filename string, data io.Reader) (int, error) + DeleteFile(filePath string) error + DeleteDirectory(dirPath string) error + DeleteDirectoryRecursive(dirPath string) error +} + +type FileNode struct { + BasePath string, + FileName string, + IsDirectory bool, + FileSize uint64, }