MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / Delete

Method Delete

internal/cache/badger_cache.go:239–250  ·  view source on GitHub ↗

Delete removes an item from the cache.

(key string)

Source from the content-addressed store, hash-verified

237
238// Delete removes an item from the cache.
239func (c *BadgerCache) Delete(key string) error {
240 err := c.db.Update(func(txn *badger.Txn) error {
241 return txn.Delete([]byte(key))
242 })
243 if err != nil {
244 return fmt.Errorf("badger delete operation: %w", err)
245 }
246
247 getCacheLogger().Debug("Deleted cache item: %s", key)
248
249 return nil
250}
251
252// Clear removes all items from the cache.
253func (c *BadgerCache) Clear() error {

Callers 2

GetMethod · 0.95

Calls 4

getCacheLoggerFunction · 0.85
UpdateMethod · 0.65
DeleteMethod · 0.65
DebugMethod · 0.65

Tested by 1