Registry / utility / go-redis-cache-v9

go-redis-cache-v9

JSON →
library9.0.0gogounverified

A Go caching library with Redis backend, supporting various serialization and cache strategies.

go get github.com/go-redis/cache/v9
INSTALL
IMPORT
SIG · GO-REDIS-CACHE-V9
G
go-redis-cache-v9
utilitygov9.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cache
github.com/go-redis/cache/v9

Set and get a value from Redis cache

package main import ( "context" "fmt" "github.com/go-redis/cache/v9" "github.com/redis/go-redis/v9" ) func main() { ring := redis.NewRing(&redis.RingOptions{ Addrs: map[string]string{"server": ":6379"}, }) mycache := cache.New(&cache.Options{ Redis: ring, }) ctx := context.Background() key := "greeting" if err := mycache.Set(&cache.Item{ Ctx: ctx, Key: key, Value: "hello", }); err != nil { panic(err) } var value string if err := mycache.Get(ctx, key, &value); err != nil { panic(err) } fmt.Println(value) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
9.0.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
go-redis-cache-v9 — go get go-redis-cache-v9 · libregistry