MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / unmarshalData

Function unmarshalData

cmd/client/command/client.go:62–75  ·  view source on GitHub ↗
(body []byte, v any)

Source from the content-addressed store, hash-verified

60}
61
62func unmarshalData(body []byte, v any) error {
63 if len(body) == 0 {
64 return errors.New("empty response body")
65 }
66
67 rv := reflect.ValueOf(v)
68 if rv.Kind() != reflect.Ptr || rv.IsNil() {
69 return errors.New("unmarshal receiver was non-pointer")
70 }
71
72 var rsp response
73 rsp.Data = v
74 return json.Unmarshal(body, &rsp)
75}
76
77func unmarshalError(body []byte) error {
78 var rsp response

Callers 5

listRaftPeersFunction · 0.85
failoverShardFunction · 0.85
getClusterFunction · 0.85
listNamespaceFunction · 0.85
listClustersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected