26 lines
523 B
Go
26 lines
523 B
Go
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 {
|
|
BasePath string,
|
|
FileName string,
|
|
IsDirectory bool,
|
|
FileSize uint64,
|
|
}
|