MCPcopy
hub / github.com/cortexlabs/cortex / UploadReaderToS3

Method UploadReaderToS3

pkg/lib/aws/s3.go:398–412  ·  view source on GitHub ↗
(data io.Reader, bucket string, key string)

Source from the content-addressed store, hash-verified

396}
397
398func (c *Client) UploadReaderToS3(data io.Reader, bucket string, key string) error {
399 _, err := c.S3Uploader().Upload(&s3manager.UploadInput{
400 Bucket: aws.String(bucket),
401 Key: aws.String(key),
402 Body: data,
403 ACL: aws.String("private"),
404 ContentDisposition: aws.String("attachment"),
405 })
406
407 if err != nil {
408 return errors.Wrap(err, S3Path(bucket, key))
409 }
410
411 return nil
412}
413
414func (c *Client) UploadFileToS3(path string, bucket string, key string) error {
415 file, err := files.Open(path)

Callers 4

UploadFileToS3Method · 0.95
UploadBytesToS3Method · 0.95
UploadStringToS3Method · 0.95
CreateEmptyS3FileMethod · 0.95

Calls 5

S3UploaderMethod · 0.95
WrapFunction · 0.92
S3PathFunction · 0.85
UploadMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected