RemoveObjectsWithResult removes multiple objects from a bucket while it is possible to specify objects versions which are received from objectsCh. Remove results, successes and failures are sent back via RemoveObjectResult channel
(ctx context.Context, bucketName string, objectsCh <-chan ObjectInfo, opts RemoveObjectsOptions)
| 374 | // objectsCh. Remove results, successes and failures are sent back via |
| 375 | // RemoveObjectResult channel |
| 376 | func (c *Client) RemoveObjectsWithResult(ctx context.Context, bucketName string, objectsCh <-chan ObjectInfo, opts RemoveObjectsOptions) <-chan RemoveObjectResult { |
| 377 | resultCh := make(chan RemoveObjectResult, 1) |
| 378 | |
| 379 | // Validate if bucket name is valid. |
| 380 | if err := s3utils.CheckValidBucketName(bucketName); err != nil { |
| 381 | defer close(resultCh) |
| 382 | resultCh <- RemoveObjectResult{ |
| 383 | Err: err, |
| 384 | } |
| 385 | return resultCh |
| 386 | } |
| 387 | // Validate objects channel to be properly allocated. |
| 388 | if objectsCh == nil { |
| 389 | defer close(resultCh) |
| 390 | resultCh <- RemoveObjectResult{ |
| 391 | Err: errInvalidArgument("Objects channel cannot be nil"), |
| 392 | } |
| 393 | return resultCh |
| 394 | } |
| 395 | |
| 396 | go c.removeObjects(ctx, bucketName, objectsCh, resultCh, opts) |
| 397 | return resultCh |
| 398 | } |
| 399 | |
| 400 | // Return true if the character is within the allowed characters in an XML 1.0 document |
| 401 | // The list of allowed characters can be found here: https://www.w3.org/TR/xml/#charsets |
no test coverage detected