Keys returns all the keys of the set structure
(regx string)
| 232 | |
| 233 | // Keys returns all the keys of the set structure |
| 234 | func (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. |
nothing calls this directly
no test coverage detected