(group map[int]*models.Group)
| 102 | } |
| 103 | |
| 104 | func (s *Topom) refillCacheGroup(group map[int]*models.Group) (map[int]*models.Group, error) { |
| 105 | if group == nil { |
| 106 | return s.store.ListGroup() |
| 107 | } |
| 108 | for i, _ := range group { |
| 109 | if group[i] != nil { |
| 110 | continue |
| 111 | } |
| 112 | g, err := s.store.LoadGroup(i, false) |
| 113 | if err != nil { |
| 114 | return nil, err |
| 115 | } |
| 116 | if g != nil { |
| 117 | group[i] = g |
| 118 | } else { |
| 119 | delete(group, i) |
| 120 | } |
| 121 | } |
| 122 | return group, nil |
| 123 | } |
| 124 | |
| 125 | func (s *Topom) refillCacheProxy(proxy map[string]*models.Proxy) (map[string]*models.Proxy, error) { |
| 126 | if proxy == nil { |
no test coverage detected