作者:king | 来源:互联网 | 2023-12-12 14:13
Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正
I'm trying to figure out a way to generate torrent files from a bucket, using the AWS SDK for Go.
我正在尝试使用AWS SDK for Go找出一种从存储桶生成torrent文件的方法。
I'm using a pre-signed url (since its a private bucket):
我正在使用预先签名的网址(因为它是一个私人存储桶):
svc := s3.New(session.New(config))
req, _ := svc.GetObjectRequest(&s3.GetObjectInput{
Bucket: aws.String("bucketName"),
Key: "key",
})
// sign the url
url, err := req.Presign(120 * time.Minute)
From the docs, to generate a torrent, the syntax:
从文档中,生成一个torrent,语法:
GET /ObjectName?torrent HTTP/1.1
Host: BucketName.s3.amazonaws.com
Date: date
Authorization: authorization string
How do I add the ?torrent
parameter to a presigned url in GO?
如何将?torrent参数添加到GO中的预签名网址?
1 个解决方案