getUnderlyingHTTPTransport returns the *http.Transport used by the http client. If the http client was initialized with a HTTPTransporter, it returns the wrapped *http.Transport.
()
| 531 | // getUnderlyingHTTPTransport returns the *http.Transport used by the http client. If the http |
| 532 | // client was initialized with a HTTPTransporter, it returns the wrapped *http.Transport. |
| 533 | func (r *ProtocolIncus) getUnderlyingHTTPTransport() (*http.Transport, error) { |
| 534 | switch t := r.http.Transport.(type) { |
| 535 | case *http.Transport: |
| 536 | return t, nil |
| 537 | case HTTPTransporter: |
| 538 | return t.Transport(), nil |
| 539 | default: |
| 540 | return nil, fmt.Errorf("Unexpected http.Transport type, %T", r) |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | // getSourceImageConnectionInfo returns the connection information for the source image. |
| 545 | // The returned `info` is nil if the source image is local. In this process, the `instSrc` |
no test coverage detected