(entityID string)
| 136 | } |
| 137 | |
| 138 | func (i *InstanceCache) GetEntityInstances(entityID string) []params.Instance { |
| 139 | pools := GetEntityPools(entityID) |
| 140 | poolsAsMap := map[string]bool{} |
| 141 | for _, pool := range pools { |
| 142 | poolsAsMap[pool.ID] = true |
| 143 | } |
| 144 | |
| 145 | ret := []params.Instance{} |
| 146 | for _, val := range i.GetAllInstances() { |
| 147 | if _, ok := poolsAsMap[val.PoolID]; ok { |
| 148 | ret = append(ret, val) |
| 149 | } |
| 150 | } |
| 151 | return ret |
| 152 | } |
| 153 | |
| 154 | func SetInstanceCache(instance params.Instance) { |
| 155 | instanceCache.SetInstance(instance) |
no test coverage detected