refactor: update storage interface to use io.Reader for Save method and remove stream implementations

This commit is contained in:
krau
2025-03-21 23:05:09 +08:00
parent ed0837a89b
commit 2d2becccf6
9 changed files with 77 additions and 338 deletions

View File

@@ -20,12 +20,7 @@ type Storage interface {
Type() types.StorageType
Name() string
JoinStoragePath(task types.Task) string
Save(cttx context.Context, localFilePath, storagePath string) error
}
type StreamStorage interface {
Storage
NewUploadStream(ctx context.Context, path string) (io.WriteCloser, error)
Save(ctx context.Context, reader io.Reader, storagePath string) error
}
var Storages = make(map[string]Storage)