import (
"github.com/freespace8/cache"
"github.com/redis/go-redis/v9"
)
var rdb = redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Username: "root",
Password: "",
})
rc := cache.NewCache(rdb,
cache.WithPrefix("cache:"),
cache.WithDelay(0*time.Second),
)
rc.Fetch("key", 30*time.Second, func() (string, error) {
time.Sleep(1*time.Second)
return "value", nil
})
-
Notifications
You must be signed in to change notification settings - Fork 0
freespace8/cache
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published