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

Method InfoServer

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

Source from the content-addressed store, hash-verified

505}
506
507func (s *apiServer) InfoServer(params martini.Params) (int, string) {
508 addr, err := s.parseAddr(params)
509 if err != nil {
510 return rpc.ApiResponseError(err)
511 }
512 c, err := redis.NewClient(addr, s.topom.Config().ProductAuth, time.Second)
513 if err != nil {
514 log.WarnErrorf(err, "create redis client to %s failed", addr)
515 return rpc.ApiResponseError(err)
516 }
517 defer c.Close()
518 if info, err := c.InfoFull(); err != nil {
519 return rpc.ApiResponseError(err)
520 } else {
521 return rpc.ApiResponseJson(info)
522 }
523}
524
525func (s *apiServer) InfoSentinel(params martini.Params) (int, string) {
526 addr, err := s.parseAddr(params)

Callers

nothing calls this directly

Calls 5

parseAddrMethod · 0.95
CloseMethod · 0.95
InfoFullMethod · 0.95
WarnErrorfMethod · 0.80
ConfigMethod · 0.45

Tested by

no test coverage detected