(g *models.Group, addr string)
| 183 | } |
| 184 | |
| 185 | func (ctx *context) getGroupIndex(g *models.Group, addr string) (int, error) { |
| 186 | for i, x := range g.Servers { |
| 187 | if x.Addr == addr { |
| 188 | return i, nil |
| 189 | } |
| 190 | } |
| 191 | return -1, errors.Errorf("group-[%d] doesn't have server-[%s]", g.Id, addr) |
| 192 | } |
| 193 | |
| 194 | func (ctx *context) getGroupByServer(addr string) (*models.Group, int, error) { |
| 195 | for _, g := range ctx.group { |
no test coverage detected