gocache
gocache copied to clipboard
ChainCache.Get failing with BigCache store v4.2.0 (GetWithTTL not implemented error)
When using BigCache in a chain, ChainCache.Get fails because it uses GetWithTTL and that function in BigCache is not implemented and returns an error. The change was merged recently: https://github.com/eko/gocache/commit/d94f5d2c9ced337b74fe48434f6f141188e9a85a in big cache store v4.2.0 https://github.com/eko/gocache/compare/store/bigcache/v4.1.2...store/bigcache/v4.2.0
Steps for Reproduction
- Set up a chain cache with a BigCache store
bigcacheClient, _ := bigcache.New(ctx, bigcache.DefaultConfig(5 * time.Minute))
bigcacheStore := bigcache_store.NewBigcache(bigcacheClient)
bigCacheCache := cache.New[[]byte](bigcacheStore)
chain := cache.NewChain[[]byte](bigCacheCache)
- Get a value
_, err := chain.Get(ctx, "key")
fmt.Printf("%v\n", err)
- See how it returns an error
Expected behavior: The function does not return an error
Actual behavior: The function returns an error
Platforms:
macOS and dockerized Linux from scratch
Versions:
gocache v4.1.4 go 1.21 BigCache store v4.2.0 BigCache v3.1.0