MCPcopy
hub / github.com/mudler/LocalAI / NewWithTimeout

Function NewWithTimeout

pkg/httpclient/client.go:175–177  ·  view source on GitHub ↗

NewWithTimeout returns a hardened client with an overall Timeout. Use for simple request/response calls; for streaming, use New with a context deadline.

(timeout time.Duration, opts ...Option)

Source from the content-addressed store, hash-verified

173// NewWithTimeout returns a hardened client with an overall Timeout. Use for
174// simple request/response calls; for streaming, use New with a context deadline.
175func NewWithTimeout(timeout time.Duration, opts ...Option) *http.Client {
176 return New(append([]Option{WithTimeout(timeout)}, opts...)...)
177}
178
179// Harden applies the default hardening (refuse redirects, TLS 1.2 floor) to an
180// existing client in place, for the cases where a third-party library hands us

Callers 12

fetchGitHubUserInfoFunction · 0.92
fetchGitHubPrimaryEmailFunction · 0.92
proxyHTTPToWorkerFunction · 0.92
audio.goFile · 0.92
video.goFile · 0.92
httpClientMethod · 0.92
sendWebhookMethod · 0.92
base64.goFile · 0.92
NewFunction · 0.92
client_test.goFile · 0.92
NewReleaseManagerFunction · 0.92

Calls 2

WithTimeoutFunction · 0.85
NewFunction · 0.70

Tested by

no test coverage detected