client := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "",
DB: 0, // use default DB
})
rc := rockscache.NewClient(client, rockscache.NewDefaultOptions())
rc.Fetch("test1", 60 * time.Second, func () (string, error) {
return "test1", nil
})
rc.TagAsDeleted("test1")
value, _ := rc.Fetch("test1", 60 * time.Second, func () (string, error) {
return "test2", nil
})
fmt.Println("value:", value) // except return "test2", but got "test1"