Skip to content

NewIterator Output ExpiresAt #116

@MarketSmart

Description

@MarketSmart

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)),
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions