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

Method Download

pkg/async-gateway/storage.go:71–84  ·  view source on GitHub ↗

Download downloads a file from S3 into memory

(key string)

Source from the content-addressed store, hash-verified

69
70// Download downloads a file from S3 into memory
71func (s *s3) Download(key string) ([]byte, error) {
72 buff := &aws.WriteAtBuffer{}
73 input := awss3.GetObjectInput{
74 Key: aws.String(key),
75 Bucket: aws.String(s.bucket),
76 }
77
78 _, err := s.downloader.Download(buff, &input)
79 if err != nil {
80 return nil, err
81 }
82
83 return buff.Bytes(), nil
84}
85
86// List lists a set of files from a given S3 path.
87// Works only for one level deep sub-paths.

Callers

nothing calls this directly

Calls 2

DownloadMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected