MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / DeleteObject

Method DeleteObject

cmd/disk-cache.go:166–180  ·  view source on GitHub ↗

DeleteObject clears cache entry if backend delete operation succeeds

(ctx context.Context, bucket, object string, opts ObjectOptions)

Source from the content-addressed store, hash-verified

164
165// DeleteObject clears cache entry if backend delete operation succeeds
166func (c *cacheObjects) DeleteObject(ctx context.Context, bucket, object string, opts ObjectOptions) (objInfo ObjectInfo, err error) {
167 if objInfo, err = c.InnerDeleteObjectFn(ctx, bucket, object, opts); err != nil {
168 return
169 }
170 if c.isCacheExclude(bucket, object) || c.skipCache() {
171 return
172 }
173
174 dcache, cerr := c.getCacheLoc(bucket, object)
175 if cerr != nil {
176 return objInfo, cerr
177 }
178 dcache.Delete(ctx, bucket, object)
179 return
180}
181
182// DeleteObjects batch deletes objects in slice, and clears any cached entries
183func (c *cacheObjects) DeleteObjects(ctx context.Context, bucket string, objects []ObjectToDelete, opts ObjectOptions) ([]DeletedObject, []error) {

Callers 1

DeleteObjectsMethod · 0.95

Calls 4

isCacheExcludeMethod · 0.95
skipCacheMethod · 0.95
getCacheLocMethod · 0.95
DeleteMethod · 0.65

Tested by

no test coverage detected