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

Method Keys

structure/set.go:234–252  ·  view source on GitHub ↗

Keys returns all the keys of the set structure

(regx string)

Source from the content-addressed store, hash-verified

232
233// Keys returns all the keys of the set structure
234func (s *SetStructure) Keys(regx string) ([]string, error) {
235 toRegexp := convertToRegexp(regx)
236 compile, err := regexp.Compile(toRegexp)
237 if err != nil {
238 return nil, err
239 }
240 var keys []string
241 byteKeys := s.db.GetListKeys()
242 for _, key := range byteKeys {
243 if compile.MatchString(string(key)) {
244 // check if deleted
245 if !s.exists(string(key)) {
246 continue
247 }
248 keys = append(keys, string(key))
249 }
250 }
251 return keys, nil
252}
253
254// SUnionStore calculates and stores the union of multiple sets
255// in a destination set.

Callers

nothing calls this directly

Calls 3

existsMethod · 0.95
convertToRegexpFunction · 0.85
GetListKeysMethod · 0.80

Tested by

no test coverage detected