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

Method RemoveObject

api-remove.go:140–151  ·  view source on GitHub ↗

RemoveObject removes an object from a bucket.

(ctx context.Context, bucketName, objectName string, opts RemoveObjectOptions)

Source from the content-addressed store, hash-verified

138
139// RemoveObject removes an object from a bucket.
140func (c *Client) RemoveObject(ctx context.Context, bucketName, objectName string, opts RemoveObjectOptions) error {
141 // Input validation.
142 if err := s3utils.CheckValidBucketName(bucketName); err != nil {
143 return err
144 }
145 if err := s3utils.CheckValidObjectName(objectName); err != nil {
146 return err
147 }
148
149 res := c.removeObject(ctx, bucketName, objectName, opts)
150 return res.Err
151}
152
153func (c *Client) removeObject(ctx context.Context, bucketName, objectName string, opts RemoveObjectOptions) RemoveObjectResult {
154 // Get resources properly escaped and lined up before

Callers 14

testListObjectVersionsFunction · 0.95
testFunctionalFunction · 0.95
testGetObjectModifiedFunction · 0.95
TestGetObjectCoreFunction · 0.80
TestCoreCopyObjectFunction · 0.80
TestCoreCopyObjectPartFunction · 0.80
TestCorePutObjectFunction · 0.80
TestCoreMultipartUploadFunction · 0.80
cleanupBucketFunction · 0.80

Calls 3

removeObjectMethod · 0.95
CheckValidBucketNameFunction · 0.92
CheckValidObjectNameFunction · 0.92

Tested by 7

TestGetObjectCoreFunction · 0.64
TestCoreCopyObjectFunction · 0.64
TestCoreCopyObjectPartFunction · 0.64
TestCorePutObjectFunction · 0.64
TestCoreMultipartUploadFunction · 0.64