(httpClient *http.Client, ttl time.Duration)
| 185 | } |
| 186 | |
| 187 | func NewCachedHTTPClient(httpClient *http.Client, ttl time.Duration) *http.Client { |
| 188 | newClient := *httpClient |
| 189 | newClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl) |
| 190 | return &newClient |
| 191 | } |
| 192 | |
| 193 | // NewCachedHTTPClientWithStatuses is like NewCachedHTTPClient, but it also caches responses with the given status |
| 194 | // codes, such as 403, which are not cached by default. |
no test coverage detected