* SAdds attempts to add multiple members to a set identified by the 'key' parameter. The members to add are variadic and come as 'members...' in the function signature. This means the function accepts an arbitrary number of strings to be added to the set. Parameters: - 's': Pointer to an instance
(key string, ttl int64, members ...string)
| 60 | All the methods like 'getZSetFromDB', 'setZSetToDB', and 'add' handle the lower-level logic associated with database interaction and set manipulation. |
| 61 | */ |
| 62 | func (s *SetStructure) SAdds(key string, ttl int64, members ...string) error { |
| 63 | fs, err := s.checkAndGetSet(key, true) |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | var expirationTime time.Duration |
| 68 | fs.add(members...) |
| 69 | expirationTime = time.Duration(ttl) * time.Second |
| 70 | return s.setSetToDB(stringToBytesWithKey(key), fs, expirationTime) |
| 71 | } |
| 72 | |
| 73 | // SRem removes a member from a set |
| 74 | func (s *SetStructure) SRem(key, member string) error { |
no test coverage detected