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

Method SRems

structure/set.go:79–90  ·  view source on GitHub ↗

SRems removes multiple members from a set

(key string, ttl int64, members ...string)

Source from the content-addressed store, hash-verified

77
78// SRems removes multiple members from a set
79func (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
93func (s *SetStructure) SCard(key string) (int, error) {

Callers 1

SRemMethod · 0.95

Calls 4

checkAndGetSetMethod · 0.95
setSetToDBMethod · 0.95
stringToBytesWithKeyFunction · 0.85
removeMethod · 0.80

Tested by

no test coverage detected