MCPcopy Create free account
hub / github.com/AdRoll/baker / NewS3Input

Function NewS3Input

input/inpututils/s3.go:24–37  ·  view source on GitHub ↗
(region, bucket string)

Source from the content-addressed store, hash-verified

22}
23
24func NewS3Input(region, bucket string) (*S3Input, error) {
25 sess, err := session.NewSession(&aws.Config{Region: aws.String(region)})
26 if err != nil {
27 return nil, fmt.Errorf("can't create aws session: %v", err)
28 }
29
30 svc := s3.New(sess)
31 s := &S3Input{
32 Bucket: bucket,
33 svc: svc,
34 }
35 s.CompressedInput = NewCompressedInput(s.openS3File, s.sizeS3File, make(chan bool, 1))
36 return s, nil
37}
38
39// SetS3API allows to replace the S3API, for tests.
40func (s3 *S3Input) SetS3API(s3API s3iface.S3API) {

Callers 3

NewSQSFunction · 0.92

Calls 2

NewCompressedInputFunction · 0.85
StringMethod · 0.45