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

Method newTopomClient

cmd/admin/dashboard.go:90–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88}
89
90func (t *cmdDashboard) newTopomClient() *topom.ApiClient {
91 c := topom.NewApiClient(t.addr)
92
93 log.Debugf("call rpc model to dashboard %s", t.addr)
94 p, err := c.Model()
95 if err != nil {
96 log.PanicErrorf(err, "call rpc model to dashboard %s failed", t.addr)
97 }
98 log.Debugf("call rpc model OK")
99
100 c.SetXAuth(p.ProductName)
101
102 log.Debugf("call rpc xping to dashboard %s", t.addr)
103 if err := c.XPing(); err != nil {
104 log.PanicErrorf(err, "call rpc xping to dashboard %s failed", t.addr)
105 }
106 log.Debugf("call rpc xping OK")
107
108 return c
109}
110
111func (t *cmdDashboard) handleOverview(d map[string]interface{}) {
112 c := t.newTopomClient()

Callers 12

handleOverviewMethod · 0.95
handleLogLevelMethod · 0.95
handleShutdownMethod · 0.95
handleReloadMethod · 0.95
handleSlotsCommandMethod · 0.95
parseProxyTokensMethod · 0.95
handleProxyCommandMethod · 0.95
handleGroupCommandMethod · 0.95
handleSentinelCommandMethod · 0.95
handleSlotRebalanceMethod · 0.95

Calls 5

ModelMethod · 0.95
SetXAuthMethod · 0.95
XPingMethod · 0.95
DebugfMethod · 0.80
PanicErrorfMethod · 0.80

Tested by

no test coverage detected