summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-cache/v3/cache.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-05-14 14:17:03 +0100
committerLibravatar GitHub <noreply@github.com>2023-05-14 15:17:03 +0200
commit2b7c815ed63d0e9d8630eb63975c06a51d5a1e93 (patch)
treecb2b09a0f230cf4d3b058222b9e42e77bc2b9537 /vendor/codeberg.org/gruf/go-cache/v3/cache.go
parent[frogend/chore] Fix profile domain (#1779) (diff)
downloadgotosocial-2b7c815ed63d0e9d8630eb63975c06a51d5a1e93.tar.xz
[bugfix] update go-cache to v3.3.3 (#1778)v0.9.0-rc1
* update go-cache to v3.3.1 Signed-off-by: kim <grufwub@gmail.com> * bump go-cache again Signed-off-by: kim <grufwub@gmail.com> * remove accidentally comitted build-script changes Signed-off-by: kim <grufwub@gmail.com> * now v3.3.3 ... Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-cache/v3/cache.go')
-rw-r--r--vendor/codeberg.org/gruf/go-cache/v3/cache.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/vendor/codeberg.org/gruf/go-cache/v3/cache.go b/vendor/codeberg.org/gruf/go-cache/v3/cache.go
index 8271036a5..1192cf3e8 100644
--- a/vendor/codeberg.org/gruf/go-cache/v3/cache.go
+++ b/vendor/codeberg.org/gruf/go-cache/v3/cache.go
@@ -15,10 +15,10 @@ type Cache[Key comparable, Value any] interface {
Stop() bool
// SetEvictionCallback sets the eviction callback to the provided hook.
- SetEvictionCallback(hook func(*ttlcache.Entry[Key, Value]))
+ SetEvictionCallback(hook func(Key, Value))
// SetInvalidateCallback sets the invalidate callback to the provided hook.
- SetInvalidateCallback(hook func(*ttlcache.Entry[Key, Value]))
+ SetInvalidateCallback(hook func(Key, Value))
// SetTTL sets the cache item TTL. Update can be specified to force updates of existing items in the cache, this will simply add the change in TTL to their current expiry time.
SetTTL(ttl time.Duration, update bool)
@@ -44,6 +44,9 @@ type Cache[Key comparable, Value any] interface {
// Invalidate deletes a value from the cache, calling the invalidate callback.
Invalidate(key Key) bool
+ // InvalidateAll is equivalent to multiple Invalidate calls.
+ InvalidateAll(keys ...Key) bool
+
// Clear empties the cache, calling the invalidate callback on each entry.
Clear()