MCPcopy Create free account
hub / github.com/prometheus/common / HTTPClientConfig

Struct HTTPClientConfig

config/http_config.go:289–314  ·  view source on GitHub ↗

HTTPClientConfig configures an HTTP client.

Source from the content-addressed store, hash-verified

287
288// HTTPClientConfig configures an HTTP client.
289type HTTPClientConfig struct {
290 // The HTTP basic authentication credentials for the targets.
291 BasicAuth *BasicAuth `yaml:"basic_auth,omitempty" json:"basic_auth,omitempty"`
292 // The HTTP authorization credentials for the targets.
293 Authorization *Authorization `yaml:"authorization,omitempty" json:"authorization,omitempty"`
294 // The OAuth2 client credentials used to fetch a token for the targets.
295 OAuth2 *OAuth2 `yaml:"oauth2,omitempty" json:"oauth2,omitempty"`
296 // The bearer token for the targets. Deprecated in favour of
297 // Authorization.Credentials.
298 BearerToken Secret `yaml:"bearer_token,omitempty" json:"bearer_token,omitempty"`
299 // The bearer token file for the targets. Deprecated in favour of
300 // Authorization.CredentialsFile.
301 BearerTokenFile string `yaml:"bearer_token_file,omitempty" json:"bearer_token_file,omitempty"`
302 // TLSConfig to use to connect to the targets.
303 TLSConfig TLSConfig `yaml:"tls_config,omitempty" json:"tls_config,omitempty"`
304 // FollowRedirects specifies whether the client should follow HTTP 3xx redirects.
305 // The omitempty flag is not set, because it would be hidden from the
306 // marshalled configuration when set to false.
307 FollowRedirects bool `yaml:"follow_redirects" json:"follow_redirects"`
308 // EnableHTTP2 specifies whether the client should configure HTTP2.
309 // The omitempty flag is not set, because it would be hidden from the
310 // marshalled configuration when set to false.
311 EnableHTTP2 bool `yaml:"enable_http2" json:"enable_http2"`
312 // Proxy configuration.
313 ProxyConfig `yaml:",inline"`
314}
315
316// SetDirectory joins any relative file paths with dir.
317func (c *HTTPClientConfig) SetDirectory(dir string) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected