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

Method checkAndGetSet

structure/set.go:306–319  ·  view source on GitHub ↗
(key string, createIfNotExist bool)

Source from the content-addressed store, hash-verified

304}
305
306func (s *SetStructure) checkAndGetSet(key string, createIfNotExist bool) (*FSets, error) {
307 // Check if value is empty
308 if err := checkKey(key); err != nil {
309 return nil, err
310 }
311 keyBytes := stringToBytesWithKey(key)
312 // Get the list
313 set, _, err := s.getSetFromDB(keyBytes, createIfNotExist)
314 if err != nil {
315 return nil, err
316 }
317
318 return set, nil
319}
320
321// internal/private functions
322

Callers 8

SAddsMethod · 0.95
SRemsMethod · 0.95
SCardMethod · 0.95
SMembersMethod · 0.95
SIsMemberMethod · 0.95
SUnionMethod · 0.95
SInterMethod · 0.95
SDiffMethod · 0.95

Calls 3

getSetFromDBMethod · 0.95
checkKeyFunction · 0.85
stringToBytesWithKeyFunction · 0.85

Tested by

no test coverage detected