MCPcopy Index your code
hub / github.com/ByteStorage/FlyDB / SAdds

Method SAdds

structure/set.go:62–71  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

60All the methods like 'getZSetFromDB', 'setZSetToDB', and 'add' handle the lower-level logic associated with database interaction and set manipulation.
61*/
62func (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
74func (s *SetStructure) SRem(key, member string) error {

Callers 3

SAddMethod · 0.95
SUnionStoreMethod · 0.95
SInterStoreMethod · 0.95

Calls 4

checkAndGetSetMethod · 0.95
setSetToDBMethod · 0.95
stringToBytesWithKeyFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected