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

Method handleSyncActionCommand

cmd/admin/dashboard.go:673–700  ·  view source on GitHub ↗
(d map[string]interface{})

Source from the content-addressed store, hash-verified

671}
672
673func (t *cmdDashboard) handleSyncActionCommand(d map[string]interface{}) {
674 c := t.newTopomClient()
675
676 switch {
677
678 case d["--create"].(bool):
679
680 addr := utils.ArgumentMust(d, "--addr")
681
682 log.Debugf("call rpc create-sync-action to dashboard %s", t.addr)
683 if err := c.SyncCreateAction(addr); err != nil {
684 log.PanicErrorf(err, "call rpc create-sync-action to dashboard %s failed", t.addr)
685 }
686 log.Debugf("call rpc create-sync-action OK")
687
688 case d["--remove"].(bool):
689
690 addr := utils.ArgumentMust(d, "--addr")
691
692 log.Debugf("call rpc remove-sync-action to dashboard %s", t.addr)
693 if err := c.SyncRemoveAction(addr); err != nil {
694 log.PanicErrorf(err, "call rpc remove-sync-action to dashboard %s failed", t.addr)
695 }
696 log.Debugf("call rpc remove-sync-action OK")
697
698 }
699
700}
701
702func (t *cmdDashboard) handleSlotActionCommand(d map[string]interface{}) {
703 c := t.newTopomClient()

Callers 1

MainMethod · 0.95

Calls 5

newTopomClientMethod · 0.95
DebugfMethod · 0.80
PanicErrorfMethod · 0.80
SyncCreateActionMethod · 0.45
SyncRemoveActionMethod · 0.45

Tested by

no test coverage detected