SRems removes multiple members from a set
(key string, ttl int64, members ...string)
| 77 | |
| 78 | // SRems removes multiple members from a set |
| 79 | func (s *SetStructure) SRems(key string, ttl int64, members ...string) error { |
| 80 | fs, err := s.checkAndGetSet(key, false) |
| 81 | if err != nil { |
| 82 | return err |
| 83 | } |
| 84 | var expirationTime time.Duration |
| 85 | if err = fs.remove(members...); err != nil { |
| 86 | return err |
| 87 | } |
| 88 | expirationTime = time.Duration(ttl) * time.Second |
| 89 | return s.setSetToDB(stringToBytesWithKey(key), fs, expirationTime) |
| 90 | } |
| 91 | |
| 92 | // SCard gets the cardinality (size) of a set |
| 93 | func (s *SetStructure) SCard(key string) (int, error) { |
no test coverage detected