16
vendor/github.com/prometheus/common/README.md
generated
vendored
16
vendor/github.com/prometheus/common/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||
# Common
|
||||
[](https://travis-ci.org/prometheus/common)
|
||||
|
||||
This repository contains Go libraries that are shared across Prometheus
|
||||
components and libraries.
|
||||
|
||||
* **config**: Common configuration structures
|
||||
* **expfmt**: Decoding and encoding for the exposition format
|
||||
* **model**: Shared data structures
|
||||
* **promlog**: A logging wrapper around [go-kit/log](https://github.com/go-kit/kit/tree/master/log)
|
||||
* **route**: A routing wrapper around [httprouter](https://github.com/julienschmidt/httprouter) using `context.Context`
|
||||
* **server**: Common servers
|
||||
* **version**: Version information and metrics
|
||||
|
||||
## Deprecated
|
||||
* **log**: A logging wrapper around [logrus](https://github.com/sirupsen/logrus)
|
||||
22
vendor/github.com/prometheus/common/go.mod
generated
vendored
22
vendor/github.com/prometheus/common/go.mod
generated
vendored
@@ -1,22 +0,0 @@
|
||||
module github.com/prometheus/common
|
||||
|
||||
require (
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect
|
||||
github.com/go-kit/kit v0.9.0
|
||||
github.com/go-logfmt/logfmt v0.4.0 // indirect
|
||||
github.com/golang/protobuf v1.3.2
|
||||
github.com/julienschmidt/httprouter v1.2.0
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
|
||||
github.com/pkg/errors v0.8.1
|
||||
github.com/prometheus/client_golang v1.0.0
|
||||
github.com/prometheus/client_model v0.2.0
|
||||
github.com/sirupsen/logrus v1.4.2
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 // indirect
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6
|
||||
gopkg.in/yaml.v2 v2.2.4
|
||||
)
|
||||
|
||||
go 1.11
|
||||
4
vendor/github.com/prometheus/common/model/time.go
generated
vendored
4
vendor/github.com/prometheus/common/model/time.go
generated
vendored
@@ -186,6 +186,10 @@ var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$")
|
||||
// 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) {
|
||||
// Allow 0 without a unit.
|
||||
if durationStr == "0" {
|
||||
return 0, nil
|
||||
}
|
||||
matches := durationRE.FindStringSubmatch(durationStr)
|
||||
if len(matches) != 3 {
|
||||
return 0, fmt.Errorf("not a valid duration string: %q", durationStr)
|
||||
|
||||
Reference in New Issue
Block a user