MCPcopy
hub / github.com/openfaas/faas / getHTTPClient

Method getHTTPClient

gateway/metrics/exporter.go:124–139  ·  view source on GitHub ↗
(timeout time.Duration)

Source from the content-addressed store, hash-verified

122}
123
124func (e *Exporter) getHTTPClient(timeout time.Duration) http.Client {
125
126 return http.Client{
127 Transport: &http.Transport{
128 Proxy: http.ProxyFromEnvironment,
129 DialContext: (&net.Dialer{
130 Timeout: timeout,
131 KeepAlive: 0,
132 }).DialContext,
133 MaxIdleConns: 1,
134 DisableKeepAlives: true,
135 IdleConnTimeout: 120 * time.Millisecond,
136 ExpectContinueTimeout: 1500 * time.Millisecond,
137 },
138 }
139}
140
141func (e *Exporter) getFunctions(endpointURL url.URL, namespace string) ([]types.FunctionStatus, error) {
142 timeout := 5 * time.Second

Callers 2

getFunctionsMethod · 0.95
getNamespacesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected