WithHTTPClient returns a ClientOptionsFunc that sets the http.Client for a Client. If not set, a default http.Client will be used.
(httpClient *http.Client)
| 365 | // WithHTTPClient returns a ClientOptionsFunc that sets the http.Client |
| 366 | // for a Client. If not set, a default http.Client will be used. |
| 367 | func WithHTTPClient(httpClient *http.Client) ClientOptionsFunc { |
| 368 | return func(o *clientOptions) error { |
| 369 | if httpClient == nil { |
| 370 | return errors.New("http client must not be nil") |
| 371 | } |
| 372 | |
| 373 | httpClient := *httpClient |
| 374 | o.httpClient = &httpClient |
| 375 | return nil |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | // WithTransport returns a ClientOptionsFunc that sets the http.RoundTripper |
| 380 | // for a Client. This overrides the transport set by [WithHTTPClient]. If not |
no outgoing calls
searching dependent graphs…