MCPcopy
hub / github.com/NVIDIA/aistore / ReadJSON

Function ReadJSON

cmn/http.go:161–168  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, out interface{})

Source from the content-addressed store, hash-verified

159}
160
161func ReadJSON(w http.ResponseWriter, r *http.Request, out interface{}) (err error) {
162 err = jsoniter.NewDecoder(r.Body).Decode(out)
163 cos.Close(r.Body)
164 if err == nil {
165 return
166 }
167 return WriteErrJSON(w, r, out, err)
168}
169
170func WriteErrJSON(w http.ResponseWriter, r *http.Request, out interface{}, err error) error {
171 at := thisNodeName

Callers 15

httpRevokeTokenMethod · 0.92
userAddMethod · 0.92
userLoginMethod · 0.92
httpSrvPostMethod · 0.92
httpSrvPutMethod · 0.92
httpRolePostMethod · 0.92
downloadHandlerMethod · 0.92
daeputQueryMethod · 0.92
daePathActionMethod · 0.92
daeSetPrimaryMethod · 0.92
httpRequestNewPrimaryMethod · 0.92
httpproxyvoteMethod · 0.92

Calls 2

CloseFunction · 0.92
WriteErrJSONFunction · 0.85

Tested by

no test coverage detected