Skip to content

Commit

Permalink
chore: add is it support upload config for driver
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 20, 2022
1 parent 31ff31d commit a61bb6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/driver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ type Config struct {
OnlyProxy bool
NoNeedSetLink bool
NoCache bool
NoUpload bool
}
3 changes: 3 additions & 0 deletions internal/fs/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit a61bb6a

Please sign in to comment.