mirror of
https://github.com/coredns/coredns.git
synced 2025-12-08 11:25:14 -05:00
dep ensure -update (#1001)
* dep ensure -update Run "dep ensure -update` to update all dependencies. No code changes; just the dependencies. * dep prune * add new venderod
This commit is contained in:
2
vendor/github.com/prometheus/common/README.md
generated
vendored
2
vendor/github.com/prometheus/common/README.md
generated
vendored
@@ -6,7 +6,7 @@ components and libraries.
|
||||
|
||||
* **config**: Common configuration structures
|
||||
* **expfmt**: Decoding and encoding for the exposition format
|
||||
* **log**: A logging wrapper around [logrus](https://github.com/Sirupsen/logrus)
|
||||
* **log**: A logging wrapper around [logrus](https://github.com/sirupsen/logrus)
|
||||
* **model**: Shared data structures
|
||||
* **route**: A routing wrapper around [httprouter](https://github.com/julienschmidt/httprouter) using `context.Context`
|
||||
* **version**: Version informations and metric
|
||||
|
||||
4
vendor/github.com/prometheus/common/expfmt/text_parse.go
generated
vendored
4
vendor/github.com/prometheus/common/expfmt/text_parse.go
generated
vendored
@@ -315,6 +315,10 @@ func (p *TextParser) startLabelValue() stateFn {
|
||||
if p.readTokenAsLabelValue(); p.err != nil {
|
||||
return nil
|
||||
}
|
||||
if !model.LabelValue(p.currentToken.String()).IsValid() {
|
||||
p.parseError(fmt.Sprintf("invalid label value %q", p.currentToken.String()))
|
||||
return nil
|
||||
}
|
||||
p.currentLabelPair.Value = proto.String(p.currentToken.String())
|
||||
// Special treatment of summaries:
|
||||
// - Quantile labels are special, will result in dto.Quantile later.
|
||||
|
||||
5
vendor/github.com/prometheus/common/expfmt/text_parse_test.go
generated
vendored
5
vendor/github.com/prometheus/common/expfmt/text_parse_test.go
generated
vendored
@@ -559,6 +559,11 @@ metric_bucket{le="bla"} 3.14
|
||||
`,
|
||||
err: "text format parsing error in line 3: expected float as value for 'le' label",
|
||||
},
|
||||
// 19: Invalid UTF-8 in label value.
|
||||
{
|
||||
in: "metric{l=\"\xbd\"} 3.14\n",
|
||||
err: "text format parsing error in line 1: invalid label value \"\\xbd\"",
|
||||
},
|
||||
}
|
||||
|
||||
for i, scenario := range scenarios {
|
||||
|
||||
14
vendor/github.com/prometheus/common/model/time.go
generated
vendored
14
vendor/github.com/prometheus/common/model/time.go
generated
vendored
@@ -163,9 +163,21 @@ func (t *Time) UnmarshalJSON(b []byte) error {
|
||||
// This type should not propagate beyond the scope of input/output processing.
|
||||
type Duration time.Duration
|
||||
|
||||
// Set implements pflag/flag.Value
|
||||
func (d *Duration) Set(s string) error {
|
||||
var err error
|
||||
*d, err = ParseDuration(s)
|
||||
return err
|
||||
}
|
||||
|
||||
// Type implements pflag.Value
|
||||
func (d *Duration) Type() string {
|
||||
return "duration"
|
||||
}
|
||||
|
||||
var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$")
|
||||
|
||||
// StringToDuration parses a string into a time.Duration, assuming that a year
|
||||
// ParseDuration parses a string into a time.Duration, assuming that a year
|
||||
// always has 365d, a week always has 7d, and a day always has 24h.
|
||||
func ParseDuration(durationStr string) (Duration, error) {
|
||||
matches := durationRE.FindStringSubmatch(durationStr)
|
||||
|
||||
Reference in New Issue
Block a user