MCPcopy Index your code
hub / github.com/CodisLabs/codis / EnableReplicaGroups

Method EnableReplicaGroups

pkg/topom/topom_api.go:424–445  ·  view source on GitHub ↗
(params martini.Params)

Source from the content-addressed store, hash-verified

422}
423
424func (s *apiServer) EnableReplicaGroups(params martini.Params) (int, string) {
425 if err := s.verifyXAuth(params); err != nil {
426 return rpc.ApiResponseError(err)
427 }
428 gid, err := s.parseInteger(params, "gid")
429 if err != nil {
430 return rpc.ApiResponseError(err)
431 }
432 addr, err := s.parseAddr(params)
433 if err != nil {
434 return rpc.ApiResponseError(err)
435 }
436 n, err := s.parseInteger(params, "value")
437 if err != nil {
438 return rpc.ApiResponseError(err)
439 }
440 if err := s.topom.EnableReplicaGroups(gid, addr, n != 0); err != nil {
441 return rpc.ApiResponseError(err)
442 } else {
443 return rpc.ApiResponseJson("OK")
444 }
445}
446
447func (s *apiServer) EnableReplicaGroupsAll(params martini.Params) (int, string) {
448 if err := s.verifyXAuth(params); err != nil {

Callers

nothing calls this directly

Calls 3

verifyXAuthMethod · 0.95
parseIntegerMethod · 0.95
parseAddrMethod · 0.95

Tested by

no test coverage detected