( _ context.Context, method string, path string, response *http.Response, responseBody any, )
| 5372 | } |
| 5373 | |
| 5374 | func (c *unixSocketClient) decodeJSONResponse( |
| 5375 | _ context.Context, |
| 5376 | method string, |
| 5377 | path string, |
| 5378 | response *http.Response, |
| 5379 | responseBody any, |
| 5380 | ) error { |
| 5381 | if response.StatusCode < 200 || response.StatusCode >= 300 { |
| 5382 | return readAPIError(response) |
| 5383 | } |
| 5384 | if responseBody == nil { |
| 5385 | return drainResponseBody(method, path, response.Body) |
| 5386 | } |
| 5387 | if err := json.NewDecoder(response.Body).Decode(responseBody); err != nil { |
| 5388 | return fmt.Errorf("cli: decode %s %s response: %w", method, path, err) |
| 5389 | } |
| 5390 | return nil |
| 5391 | } |
| 5392 | |
| 5393 | func (c *unixSocketClient) doSSE( |
| 5394 | ctx context.Context, |
no test coverage detected