MCPcopy
hub / github.com/uber/aresdb / getResponse

Method getResponse

controller/client/controller.go:90–111  ·  view source on GitHub ↗
(request *http.Request)

Source from the content-addressed store, hash-verified

88}
89
90func (c *ControllerHTTPClient) getResponse(request *http.Request) (respBytes []byte, err error) {
91 resp, err := c.c.Do(request)
92 if resp != nil {
93 defer resp.Body.Close()
94 }
95 if err != nil {
96 return
97 }
98
99 if resp.StatusCode != http.StatusOK {
100 err = fmt.Errorf("aresDB controller return status: %d", resp.StatusCode)
101 return
102 }
103
104 respBytes, err = ioutil.ReadAll(resp.Body)
105 if err != nil {
106 respBytes = nil
107 return
108 }
109
110 return
111}
112
113func (c *ControllerHTTPClient) getJSONResponse(request *http.Request, output interface{}) error {
114 bytes, err := c.getResponse(request)

Callers 3

getJSONResponseMethod · 0.95
GetSchemaHashMethod · 0.95
GetAssignmentHashMethod · 0.95

Calls 2

CloseMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected