mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: add option to delete storage media files
This commit is contained in:
@@ -72,3 +72,7 @@ func (a *Alist) UploadProgress() float64 {
|
||||
}
|
||||
return a.progresser()
|
||||
}
|
||||
|
||||
func (a *Alist) RemoveAll(path string) error {
|
||||
return nil
|
||||
}
|
||||
@@ -20,6 +20,7 @@ type Storage interface {
|
||||
ReadFile(string) ([]byte, error)
|
||||
WriteFile(string, []byte) error
|
||||
UploadProgress() float64
|
||||
RemoveAll(path string) error
|
||||
}
|
||||
|
||||
type uploadFunc func(destPath string, destInfo fs.FileInfo, srcReader io.Reader, mimeType *mimetype.MIME) error
|
||||
|
||||
@@ -71,3 +71,7 @@ func (l *LocalStorage) WriteFile(name string, data []byte) error {
|
||||
func (l *LocalStorage) UploadProgress() float64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (i *LocalStorage) RemoveAll(path string) error {
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
@@ -85,3 +85,7 @@ func (w *WebdavStorage) UploadProgress() float64 {
|
||||
}
|
||||
return w.progresser()
|
||||
}
|
||||
|
||||
func (w *WebdavStorage) RemoveAll(path string) error {
|
||||
return w.fs.RemoveAll(path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user