()
| 169 | } |
| 170 | |
| 171 | func (c *Cache) GetAllNamespaces() []string { |
| 172 | c.RLock() |
| 173 | defer c.RUnlock() |
| 174 | |
| 175 | unique := make(map[string]struct{}) |
| 176 | for _, ep := range c.epMap { |
| 177 | unique[ep.Namespace()] = struct{}{} |
| 178 | } |
| 179 | |
| 180 | namespaces := make([]string, 0, len(unique)) |
| 181 | for ns := range unique { |
| 182 | namespaces = append(namespaces, ns) |
| 183 | } |
| 184 | return namespaces |
| 185 | } |
| 186 | |
| 187 | func (c *Cache) GetIPsByNamespace(ns string) []net.IP { |
| 188 | c.RLock() |