DeleteObject clears cache entry if backend delete operation succeeds
(ctx context.Context, bucket, object string, opts ObjectOptions)
| 164 | |
| 165 | // DeleteObject clears cache entry if backend delete operation succeeds |
| 166 | func (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 |
| 183 | func (c *cacheObjects) DeleteObjects(ctx context.Context, bucket string, objects []ObjectToDelete, opts ObjectOptions) ([]DeletedObject, []error) { |
no test coverage detected