MCPcopy Create free account
hub / github.com/cli/cli / NewCachedHTTPClient

Function NewCachedHTTPClient

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

Source from the content-addressed store, hash-verified

133}
134
135func NewCachedHTTPClient(httpClient *http.Client, ttl time.Duration) *http.Client {
136 newClient := *httpClient
137 newClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl)
138 return &newClient
139}
140
141// AddCacheTTLHeader adds a header to the request telling the cache that the request
142// 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