(addr string)
| 192 | } |
| 193 | |
| 194 | func (ctx *context) getGroupByServer(addr string) (*models.Group, int, error) { |
| 195 | for _, g := range ctx.group { |
| 196 | for i, x := range g.Servers { |
| 197 | if x.Addr == addr { |
| 198 | return g, i, nil |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | return nil, -1, errors.Errorf("server-[%s] doesn't exist", addr) |
| 203 | } |
| 204 | |
| 205 | func (ctx *context) maxSyncActionIndex() (maxIndex int) { |
| 206 | for _, g := range ctx.group { |
no test coverage detected