StreamDebugCapture streams a pcap-formatted packet capture. The provided context does not determine the lifetime of the returned [io.ReadCloser].
(ctx context.Context)
| 1339 | // The provided context does not determine the lifetime of the |
| 1340 | // returned [io.ReadCloser]. |
| 1341 | func (lc *Client) StreamDebugCapture(ctx context.Context) (io.ReadCloser, error) { |
| 1342 | req, err := http.NewRequestWithContext(ctx, "POST", "http://"+apitype.LocalAPIHost+"/localapi/v0/debug-capture", nil) |
| 1343 | if err != nil { |
| 1344 | return nil, err |
| 1345 | } |
| 1346 | res, err := lc.doLocalRequestNiceError(req) |
| 1347 | if err != nil { |
| 1348 | return nil, err |
| 1349 | } |
| 1350 | if res.StatusCode != 200 { |
| 1351 | res.Body.Close() |
| 1352 | return nil, errors.New(res.Status) |
| 1353 | } |
| 1354 | return res.Body, nil |
| 1355 | } |
| 1356 | |
| 1357 | // WatchIPNBus subscribes to the IPN notification bus. It returns a watcher |
| 1358 | // once the bus is connected successfully. |
no test coverage detected