Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
ef45dd2474
|
|||
|
f92155a253
|
|||
|
9ea4f756e5
|
|||
|
52a472ef9f
|
@@ -0,0 +1,38 @@
|
|||||||
|
package storage
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LocalStorage struct {
|
||||||
|
BaseDir string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LocalStorage) UploadFile(dirPath string, filename string, data io.Reader) error {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LocalStorage) ListFiles(dirPath string) ([]FileNode, error) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LocalStorage) ReadFile(filePath string) (*os.File, error) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
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 (s *LocalStorage) DeleteDirectory(dirPath string) error {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LocalStorage) DeleteDirectoryRecursive(dirPath string) error {
|
||||||
|
//
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package storage
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Storage interface {
|
||||||
|
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 {
|
||||||
|
RelativeBasePath string
|
||||||
|
FileName string
|
||||||
|
IsDirectory bool
|
||||||
|
FileSize uint64
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user