(bucket string, fileKey string, fileKeys ...string)
| 249 | } |
| 250 | |
| 251 | func (c *Client) IsS3File(bucket string, fileKey string, fileKeys ...string) (bool, error) { |
| 252 | allFileKeys := append(fileKeys, fileKey) |
| 253 | for _, key := range allFileKeys { |
| 254 | _, err := c.S3().HeadObject(&s3.HeadObjectInput{ |
| 255 | Bucket: aws.String(bucket), |
| 256 | Key: aws.String(key), |
| 257 | }) |
| 258 | |
| 259 | if IsNotFoundErr(err) { |
| 260 | return false, nil |
| 261 | } |
| 262 | if err != nil { |
| 263 | return false, errors.Wrap(err, S3Path(bucket, key)) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | return true, nil |
| 268 | } |
| 269 | |
| 270 | func (c *Client) IsS3PathPrefix(s3Path string, s3Paths ...string) (bool, error) { |
| 271 | allS3Paths := append(s3Paths, s3Path) |
no test coverage detected