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

Method removeObjectsSingle

api-remove.go:665–692  ·  view source on GitHub ↗

removeObjectsSingle deletes objects one by one using single DELETE requests. This is used for endpoints that do not support multi-object delete (e.g., GCS).

(ctx context.Context, bucketName string, objectsCh <-chan ObjectInfo, resultCh chan<- RemoveObjectResult, opts RemoveObjectsOptions)

Source from the content-addressed store, hash-verified

663// removeObjectsSingle deletes objects one by one using single DELETE requests.
664// This is used for endpoints that do not support multi-object delete (e.g., GCS).
665func (c *Client) removeObjectsSingle(ctx context.Context, bucketName string, objectsCh <-chan ObjectInfo, resultCh chan<- RemoveObjectResult, opts RemoveObjectsOptions) {
666 for {
667 select {
668 case <-ctx.Done():
669 return
670 case object, ok := <-objectsCh:
671 if !ok {
672 return
673 }
674 removeResult := c.removeObject(ctx, bucketName, object.Key, RemoveObjectOptions{
675 VersionID: object.VersionID,
676 GovernanceBypass: opts.GovernanceBypass,
677 })
678 if err := removeResult.Err; err != nil {
679 // Version/object does not exist is not an error, ignore and continue.
680 switch ToErrorResponse(err).Code {
681 case NoSuchVersion, NoSuchKey:
682 continue
683 }
684 }
685 select {
686 case <-ctx.Done():
687 return
688 case resultCh <- removeResult:
689 }
690 }
691 }
692}
693
694// removeObjectsSingleIter deletes objects one by one using single DELETE requests.
695// This is used for endpoints that do not support multi-object delete (e.g., GCS).

Callers 1

removeObjectsMethod · 0.95

Calls 2

removeObjectMethod · 0.95
ToErrorResponseFunction · 0.85

Tested by

no test coverage detected