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