aboutsummaryrefslogtreecommitdiffstats
path: root/conn.go
diff options
context:
space:
mode:
authorMarc Pervaz Boocha <marcpervaz@qburst.com>2025-02-20 17:58:55 +0530
committerMarc Pervaz Boocha <marcpervaz@qburst.com>2025-02-20 17:58:55 +0530
commit2f95efc236520485c7cc1439acae24140657d76c (patch)
tree10eac60e3eec8e6b3bb9c27e131cd531363c39d6 /conn.go
parentAdded Eviction and Options setup (diff)
downloadcache-2f95efc236520485c7cc1439acae24140657d76c.tar
cache-2f95efc236520485c7cc1439acae24140657d76c.tar.gz
cache-2f95efc236520485c7cc1439acae24140657d76c.tar.bz2
cache-2f95efc236520485c7cc1439acae24140657d76c.tar.lz
cache-2f95efc236520485c7cc1439acae24140657d76c.tar.xz
cache-2f95efc236520485c7cc1439acae24140657d76c.tar.zst
cache-2f95efc236520485c7cc1439acae24140657d76c.zip
Add Tests and benchmarks
Diffstat (limited to '')
-rw-r--r--conn.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/conn.go b/conn.go
index 5df57a3..784cc02 100644
--- a/conn.go
+++ b/conn.go
@@ -188,6 +188,10 @@ func (h *DB[K, V]) Get(key K, value V) (V, time.Duration, error) {
return value, ttl, err
}
+func (h *DB[K, V]) GetValue(key K) (V, time.Duration, error) {
+ return h.Get(key, zero[V]())
+}
+
func (h *DB[K, V]) Set(key K, value V, ttl time.Duration) error {
keyData, err := msgpack.Marshal(key)
if err != nil {