Created
July 16, 2022 02:10
-
-
Save hernanhrm/519bb414a541788f808c265d746b910e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s Service) PresignV2(key string) (string, error) { | |
req, _ := s.S3.GetObjectRequest(&s3.GetObjectInput{ | |
Bucket: aws.String(s.Bucket), | |
Key: aws.String(key), | |
}) | |
signedURL, err := req.Presign(time.Minute) | |
if err != nil { | |
return "", fmt.Errorf("s3.SignKey(): %v", err) | |
} | |
return signedURL, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment