(key string, count int64, forward bool)
| 239 | var posInf = zScore{math.Inf(+1)} |
| 240 | |
| 241 | func (c Client) zPop(key string, count int64, forward bool) (membersWithScores map[string]float64, err error) { |
| 242 | membersWithScores, err = c.zGeneralRange(key, negInf, posInf, 0, count, forward, c.skN) |
| 243 | if err != nil { |
| 244 | return |
| 245 | } |
| 246 | |
| 247 | poppedMembers := make(map[string]float64) |
| 248 | |
| 249 | for member, score := range membersWithScores { |
| 250 | popped, err := c.ZREM(key, member) |
| 251 | if err != nil { |
| 252 | return poppedMembers, err |
| 253 | } |
| 254 | |
| 255 | if len(popped) > 0 { |
| 256 | poppedMembers[member] = score |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | return poppedMembers, err |
| 261 | } |
| 262 | |
| 263 | func (c Client) ZRANGE(key string, start, stop int64) (membersWithScores map[string]float64, err error) { |
| 264 | return c.zRange(key, start, stop, true) |
no test coverage detected