There is a very fine example of using the aws-sdk-go-v2 to create pre-signed URLs.
This works well but I'm stuck on setting the expiration time. I do see the PresignOptions struct has an Expires
but I'm not certain how to do that.
I also see WithPresignExpires
but alas, I also do not know how to use this given the example.
Can an example be provided here? I'm learning Go but something is just outside my grasp here.
You can also pass more options to the PresignGetObject function (aws s3 sdk example)
This example would generate this header
X-Amz-Expires=604800
which would make the link available for 7 days: