MCPcopy
hub / github.com/CodisLabs/codis / getGroupIndex

Method getGroupIndex

pkg/topom/context.go:185–192  ·  view source on GitHub ↗
(g *models.Group, addr string)

Source from the content-addressed store, hash-verified

183}
184
185func (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
194func (ctx *context) getGroupByServer(addr string) (*models.Group, int, error) {
195 for _, g := range ctx.group {

Callers 3

GroupDelServerMethod · 0.80
GroupPromoteServerMethod · 0.80
EnableReplicaGroupsMethod · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected