-
Notifications
You must be signed in to change notification settings - Fork 405
NewIterator Output ExpiresAt #116
Copy link
Copy link
Closed
Description
Could you add ExpiresAt to the iterator. I'm using this with a middle man to sync cluster cache and I want to keep the expire time. Currently we are having to make an additional call to GetWithExpiration which seems kinda inefficient.
//Loop through all cache entries
cacheDump := make(map[string]map[string]string)
iterator := c.store.NewIterator()
for entry := iterator.Next(); entry != nil; {
//Itterator wont give us the expiration time so we have to get it
_, expireAt, _ := c.store.GetWithExpiration(entry.Key)
//Add the entry to the dump
cacheDump[string(entry.Key)] = map[string]string{
"value": string(entry.Value),
"ttl": strconv.Itoa(int(expireAt)),
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels