diff options
author | Marc Pervaz Boocha <marcpervaz@qburst.com> | 2025-02-27 18:22:35 +0530 |
---|---|---|
committer | Marc Pervaz Boocha <marcpervaz@qburst.com> | 2025-02-27 18:22:35 +0530 |
commit | 7fe79f49b03fa7f6124a639d4b229e432ac3c840 (patch) | |
tree | 00abba4013c679e7c642e23a4bc9d7740841ba14 /conn.go | |
parent | Added Memorize and UpdateInPlace (diff) | |
download | cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar.gz cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar.bz2 cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar.lz cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar.xz cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.tar.zst cache-7fe79f49b03fa7f6124a639d4b229e432ac3c840.zip |
Resizing imporvements and typo fixes
Diffstat (limited to 'conn.go')
-rw-r--r-- | conn.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -311,15 +311,15 @@ func (h *DB[K, V]) UpdateInPlace(key K, processFunc func(V) (V, error), ttl time }, ttl) } -// Memoize attempts to retrieve a value from the cache. If the retrieval fails, +// Memorize attempts to retrieve a value from the cache. If the retrieval fails, // it sets the result of the factory function into the cache and returns that result. -func (h *DB[K, V]) Memoize(key K, factoryFunc func() (V, error), ttl time.Duration) (V, error) { +func (h *DB[K, V]) Memorize(key K, factoryFunc func() (V, error), ttl time.Duration) (V, error) { keyData, err := marshal(key) if err != nil { return zero[V](), err } - data, err := h.Store.Memoize(keyData, func() ([]byte, error) { + data, err := h.Store.Memorize(keyData, func() ([]byte, error) { value, err := factoryFunc() if err != nil { return nil, err |