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

Struct HTTPClientConfig

config/http_config.go:333–361  ·  view source on GitHub ↗

HTTPClientConfig configures an HTTP client.

Source from the content-addressed store, hash-verified

331
332// HTTPClientConfig configures an HTTP client.
333type HTTPClientConfig struct {
334 // The HTTP basic authentication credentials for the targets.
335 BasicAuth *BasicAuth `yaml:"basic_auth,omitempty" json:"basic_auth,omitempty"`
336 // The HTTP authorization credentials for the targets.
337 Authorization *Authorization `yaml:"authorization,omitempty" json:"authorization,omitempty"`
338 // The OAuth2 client credentials used to fetch a token for the targets.
339 OAuth2 *OAuth2 `yaml:"oauth2,omitempty" json:"oauth2,omitempty"`
340 // The bearer token for the targets. Deprecated in favour of
341 // Authorization.Credentials.
342 BearerToken Secret `yaml:"bearer_token,omitempty" json:"bearer_token,omitempty"`
343 // The bearer token file for the targets. Deprecated in favour of
344 // Authorization.CredentialsFile.
345 BearerTokenFile string `yaml:"bearer_token_file,omitempty" json:"bearer_token_file,omitempty"`
346 // TLSConfig to use to connect to the targets.
347 TLSConfig TLSConfig `yaml:"tls_config,omitempty" json:"tls_config,omitempty"`
348 // FollowRedirects specifies whether the client should follow HTTP 3xx redirects.
349 // The omitempty flag is not set, because it would be hidden from the
350 // marshalled configuration when set to false.
351 FollowRedirects bool `yaml:"follow_redirects" json:"follow_redirects"`
352 // EnableHTTP2 specifies whether the client should configure HTTP2.
353 // The omitempty flag is not set, because it would be hidden from the
354 // marshalled configuration when set to false.
355 EnableHTTP2 bool `yaml:"enable_http2" json:"enable_http2"`
356 // Proxy configuration.
357 ProxyConfig `yaml:",inline"`
358 // HTTPHeaders specify headers to inject in the requests. Those headers
359 // could be marshalled back to the users.
360 HTTPHeaders *Headers `yaml:"http_headers,omitempty" json:"http_headers,omitempty"`
361}
362
363// SetDirectory joins any relative file paths with dir.
364func (c *HTTPClientConfig) SetDirectory(dir string) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected