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

Method newProxyClient

cmd/admin/proxy.go:44–67  ·  view source on GitHub ↗
(xauth bool)

Source from the content-addressed store, hash-verified

42}
43
44func (t *cmdProxy) newProxyClient(xauth bool) *proxy.ApiClient {
45 c := proxy.NewApiClient(t.addr)
46
47 if !xauth {
48 return c
49 }
50
51 log.Debugf("call rpc model to proxy %s", t.addr)
52 p, err := c.Model()
53 if err != nil {
54 log.PanicErrorf(err, "call rpc model to proxy %s failed", t.addr)
55 }
56 log.Debugf("call rpc model OK")
57
58 c.SetXAuth(p.ProductName, t.auth, p.Token)
59
60 log.Debugf("call rpc xping to proxy %s", t.addr)
61 if err := c.XPing(); err != nil {
62 log.PanicErrorf(err, "call rpc xping failed")
63 }
64 log.Debugf("call rpc xping OK")
65
66 return c
67}
68
69func (t *cmdProxy) handleOverview(d map[string]interface{}) {
70 c := t.newProxyClient(false)

Callers 7

handleOverviewMethod · 0.95
handleStartMethod · 0.95
handleLogLevelMethod · 0.95
handleFillSlotsMethod · 0.95
handleResetStatsMethod · 0.95
handleForceGCMethod · 0.95
handleShutdownMethod · 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