Generate Torrent from Bucket via Go SDK (Amazon S3) -


i'm trying figure out way generate torrent files bucket, using aws sdk go.

i'm using pre-signed url (since private bucket):

svc := s3.new(session.new(config))     req, _ := svc.getobjectrequest(&s3.getobjectinput{         bucket: aws.string("bucketname"),         key:    "key",     })     // sign url     url, err := req.presign(120 * time.minute) 

from docs, generate torrent, syntax:

get /objectname?torrent http/1.1 host: bucketname.s3.amazonaws.com date: date authorization: authorization string 

how add ?torrent parameter presigned url in go?

try getobjecttorrent method on aws go sdk. return .torrent file in response, here example code:

svc := s3.new(session.new()) input := &s3.getobjecttorrentinput{     bucket: aws.string("bucketname"),     key:    aws.string("key"), }  result, _ := svc.getobjecttorrent(input) fmt.println(result) 

please see http://docs.aws.amazon.com/sdk-for-go/api/service/s3/#s3.getobjecttorrent more details. hope helps.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -