mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fnlb was moved to its own repo: fnproject/lb (#702)
* Fnlb was moved to its own repo: fnproject/lb * Clean up fnlb leftovers * Newer deps
This commit is contained in:
committed by
Reed Allman
parent
4ffa3d5005
commit
d3be603e54
10
vendor/github.com/prometheus/common/config/http_config.go
generated
vendored
10
vendor/github.com/prometheus/common/config/http_config.go
generated
vendored
@@ -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")
|
||||
}
|
||||
|
||||
2
vendor/github.com/prometheus/common/config/http_config_test.go
generated
vendored
2
vendor/github.com/prometheus/common/config/http_config_test.go
generated
vendored
@@ -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)
|
||||
}
|
||||
|
||||
9
vendor/github.com/prometheus/common/log/log.go
generated
vendored
9
vendor/github.com/prometheus/common/log/log.go
generated
vendored
@@ -56,11 +56,11 @@ func (s *loggerSettings) apply(ctx *kingpin.ParseContext) error {
|
||||
// To use the default Kingpin application, call AddFlags(kingpin.CommandLine)
|
||||
func AddFlags(a *kingpin.Application) {
|
||||
s := loggerSettings{}
|
||||
kingpin.Flag("log.level", "Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]").
|
||||
a.Flag("log.level", "Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]").
|
||||
Default(origLogger.Level.String()).
|
||||
StringVar(&s.level)
|
||||
defaultFormat := url.URL{Scheme: "logger", Opaque: "stderr"}
|
||||
kingpin.Flag("log.format", `Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"`).
|
||||
a.Flag("log.format", `Set the log target and format. Example: "logger:syslog?appname=bob&local=7" or "logger:stdout?json=true"`).
|
||||
Default(defaultFormat.String()).
|
||||
StringVar(&s.format)
|
||||
a.Action(s.apply)
|
||||
@@ -345,6 +345,11 @@ func Fatalf(format string, args ...interface{}) {
|
||||
baseLogger.sourced().Fatalf(format, args...)
|
||||
}
|
||||
|
||||
// AddHook adds hook to Prometheus' original logger.
|
||||
func AddHook(hook logrus.Hook) {
|
||||
origLogger.Hooks.Add(hook)
|
||||
}
|
||||
|
||||
type errorLogWriter struct{}
|
||||
|
||||
func (errorLogWriter) Write(b []byte) (int, error) {
|
||||
|
||||
3
vendor/github.com/prometheus/common/model/time.go
generated
vendored
3
vendor/github.com/prometheus/common/model/time.go
generated
vendored
@@ -214,6 +214,9 @@ func (d Duration) String() string {
|
||||
ms = int64(time.Duration(d) / time.Millisecond)
|
||||
unit = "ms"
|
||||
)
|
||||
if ms == 0 {
|
||||
return "0s"
|
||||
}
|
||||
factors := map[string]int64{
|
||||
"y": 1000 * 60 * 60 * 24 * 365,
|
||||
"w": 1000 * 60 * 60 * 24 * 7,
|
||||
|
||||
3
vendor/github.com/prometheus/common/model/time_test.go
generated
vendored
3
vendor/github.com/prometheus/common/model/time_test.go
generated
vendored
@@ -91,6 +91,9 @@ func TestParseDuration(t *testing.T) {
|
||||
out time.Duration
|
||||
}{
|
||||
{
|
||||
in: "0s",
|
||||
out: 0,
|
||||
}, {
|
||||
in: "324ms",
|
||||
out: 324 * time.Millisecond,
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user