MCPcopy
hub / github.com/minio/minio-go / RemoveObjectsWithResult

Method RemoveObjectsWithResult

api-remove.go:376–398  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

374// objectsCh. Remove results, successes and failures are sent back via
375// RemoveObjectResult channel
376func (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

Callers 1

Calls 3

removeObjectsMethod · 0.95
CheckValidBucketNameFunction · 0.92
errInvalidArgumentFunction · 0.85

Tested by

no test coverage detected