MCPcopy
hub / github.com/cli/cli / NewCachedHTTPClient

Function NewCachedHTTPClient

api/http_client.go:133–137  ·  view source on GitHub ↗
(httpClient *http.Client, ttl time.Duration)

Source from the content-addressed store, hash-verified

131}
132
133func NewCachedHTTPClient(httpClient *http.Client, ttl time.Duration) *http.Client {
134 newClient := *httpClient
135 newClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl)
136 return &newClient
137}
138
139// AddCacheTTLHeader adds a header to the request telling the cache that the request
140// should be cached for a specified amount of time.

Callers 15

extensionManagerFunction · 0.92
listRunFunction · 0.92
CapiClientFuncFunction · 0.92
NewCmdListFunction · 0.92
viewRunFunction · 0.92
listRunFunction · 0.92
createRunFunction · 0.92
editRunFunction · 0.92
listRunFunction · 0.92
editRunFunction · 0.92
checksRunFunction · 0.92
listRunFunction · 0.92

Calls 1

AddCacheTTLHeaderFunction · 0.85

Tested by

no test coverage detected