(d map[string]interface{})
| 108 | } |
| 109 | |
| 110 | func (t *cmdAdmin) dumpConfigV1(d map[string]interface{}) { |
| 111 | client := t.newTopomClient(d) |
| 112 | defer client.Close() |
| 113 | |
| 114 | prefix := filepath.Join("/zk/codis", fmt.Sprintf("db_%s", t.product)) |
| 115 | config := t.dumpConfigV1Recursively(client, prefix) |
| 116 | if m, ok := config.(map[string]interface{}); !ok || m == nil { |
| 117 | log.Panicf("cann't find product = %s [v1]", t.product) |
| 118 | } |
| 119 | b, err := json.MarshalIndent(config, "", " ") |
| 120 | if err != nil { |
| 121 | log.PanicErrorf(err, "json marshal failed") |
| 122 | } |
| 123 | fmt.Println(string(b)) |
| 124 | } |
| 125 | |
| 126 | func (t *cmdAdmin) dumpConfigV1Recursively(client models.Client, path string) interface{} { |
| 127 | files, err := client.List(path, false) |
no test coverage detected