The examples I've seen for downloading a file from S3 using the AWS SDK for Go are of the form:
downloader := s3manager.NewDownloader(session, /* other args */)
s3object := &s3.GetObjectInput{
Bucket: aws.String(myBucket),
Key: aws.String(myKey),
}
bytesDownloaded, err := downloader.Download(myFile, s3object)
That is, one uses the bucket and key to specify the file. But what if I already have the full URI of the file on S3? E.g.:
https://s3.us-west-2.amazonaws.com/myBucket/myKey
Is there a way using the SDK to specify the file to download using the URL directly?
No, the bucket is not public. In the SDK, I'm also setting the access and secret keys (elided from the example code).
Lastly, if it's simply not possible to do what I'm asking via the SDK, that's an acceptable (though not desired) answer.