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

Method sizeS3File

input/inpututils/s3.go:102–116  ·  view source on GitHub ↗
(fn string)

Source from the content-addressed store, hash-verified

100}
101
102func (s *S3Input) sizeS3File(fn string) (int64, error) {
103 _, s3Bucket, s3Key, err := s.choosePathComponents(fn)
104 if err != nil {
105 return 0, err
106 }
107
108 resp, err := s.svc.HeadObject(&s3.HeadObjectInput{
109 Bucket: aws.String(s3Bucket),
110 Key: aws.String(s3Key),
111 })
112 if err != nil {
113 return 0, err
114 }
115 return *resp.ContentLength, nil
116}
117
118// Check if scheme is s3 or s3a or s3n
119func isValidScheme(scheme string) (bool, error) {

Callers

nothing calls this directly

Calls 2

choosePathComponentsMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected