diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2018-01-16 12:03:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 12:03:31 -0500 |
commit | 2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 (patch) | |
tree | e08ff912e1924c06939f314168c3362d6f1ec0de /vendor/github.com/prometheus/common/config | |
parent | f5c8a71698d0a7a16c68be220e49fe64bfee7f5c (diff) | |
download | chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.gz chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.tar.bz2 chat-2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7.zip |
Updated dependencies and added avct/uasurfer (#8089)
* Updated dependencies and added avct/uasurfer
* Added uasurfer to NOTICE.txt
Diffstat (limited to 'vendor/github.com/prometheus/common/config')
-rw-r--r-- | vendor/github.com/prometheus/common/config/http_config.go | 10 | ||||
-rw-r--r-- | vendor/github.com/prometheus/common/config/http_config_test.go | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/vendor/github.com/prometheus/common/config/http_config.go b/vendor/github.com/prometheus/common/config/http_config.go index ff5837fa5..ea231bf8d 100644 --- a/vendor/github.com/prometheus/common/config/http_config.go +++ b/vendor/github.com/prometheus/common/config/http_config.go @@ -22,7 +22,7 @@ import ( "net/url" "strings" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" ) // BasicAuth contains basic HTTP authentication credentials. @@ -79,7 +79,9 @@ type HTTPClientConfig struct { XXX map[string]interface{} `yaml:",inline"` } -func (c *HTTPClientConfig) validate() error { +// Validate validates the HTTPClientConfig to check only one of BearerToken, +// BasicAuth and BearerTokenFile is configured. +func (c *HTTPClientConfig) Validate() error { if len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 { return fmt.Errorf("at most one of bearer_token & bearer_token_file must be configured") } @@ -96,9 +98,9 @@ func (c *HTTPClientConfig) UnmarshalYAML(unmarshal func(interface{}) error) erro if err != nil { return err } - err = c.validate() + err = c.Validate() if err != nil { - return c.validate() + return c.Validate() } return checkOverflow(c.XXX, "http_client_config") } diff --git a/vendor/github.com/prometheus/common/config/http_config_test.go b/vendor/github.com/prometheus/common/config/http_config_test.go index 1e2490bbb..4b13e101b 100644 --- a/vendor/github.com/prometheus/common/config/http_config_test.go +++ b/vendor/github.com/prometheus/common/config/http_config_test.go @@ -114,7 +114,7 @@ func TestValidateHTTPConfig(t *testing.T) { if err != nil { t.Errorf("Error loading HTTP client config: %v", err) } - err = cfg.validate() + err = cfg.Validate() if err != nil { t.Fatalf("Error validating %s: %s", "testdata/http.conf.good.yml", err) } |