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

Method loadJsonConfigV1

cmd/admin/admin.go:187–197  ·  view source on GitHub ↗
(file string)

Source from the content-addressed store, hash-verified

185}
186
187func (t *cmdAdmin) loadJsonConfigV1(file string) map[string]interface{} {
188 b, err := ioutil.ReadFile(file)
189 if err != nil {
190 log.PanicErrorf(err, "read file '%s' failed", file)
191 }
192 var v interface{}
193 if err := json.Unmarshal(b, &v); err != nil {
194 log.PanicErrorf(err, "json unmarshal failed")
195 }
196 return v.(map[string]interface{})
197}
198
199func (t *cmdAdmin) convertSlotsV1(slots map[int]*models.SlotMapping, v interface{}) {
200 m := v.(map[string]interface{})

Callers 1

handleConfigConvertMethod · 0.95

Calls 1

PanicErrorfMethod · 0.80

Tested by

no test coverage detected