chore: add is it support upload config for driver

This commit is contained in:
Noah Hsu 2022-06-20 17:14:08 +08:00
parent 31ff31d3dd
commit a61bb6ab1f
2 changed files with 4 additions and 0 deletions

View File

@ -7,4 +7,5 @@ type Config struct {
OnlyProxy bool
NoNeedSetLink bool
NoCache bool
NoUpload bool
}

View File

@ -15,6 +15,9 @@ var UploadTaskManager = task.NewTaskManager()
// Put add as a put task
func Put(ctx context.Context, account driver.Driver, parentPath string, file model.FileStreamer) error {
account, actualParentPath, err := operations.GetAccountAndActualPath(parentPath)
if account.Config().NoUpload {
return errors.New("upload is not supported")
}
if err != nil {
return errors.WithMessage(err, "failed get account")
}