-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat presign #634
Feat presign #634
Conversation
url, err := req.Presign(expire) | ||
return url, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may return directly here: return req.Presign(expire)
.
|
||
func validatePresignCommand(c *cli.Context) error { | ||
if c.Args().Len() != 1 { | ||
return fmt.Errorf("expected only one argument") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("expected only one argument") | |
return fmt.Errorf("expected a remote object url") |
@@ -558,6 +558,19 @@ func (s *S3) Read(ctx context.Context, src *url.URL) (io.ReadCloser, error) { | |||
return resp.Body, nil | |||
} | |||
|
|||
// Presign fetches the remote object url and returns its. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may remove the comment altogether.
@zemul It'd be great to have a testcase for this command. You may take a look at |
I'll go ahead and merge this PR without waiting for the OP because it's a useful feature and the more we wait, the more this PR will receive conflicts. I'll apply the changes myself later. |
Used to share object urls.