Skip to content
Snippets Groups Projects
Commit c347186e authored by renovate's avatar renovate
Browse files

Update module prometheus/common to v0.19.0

parent 914c7772
No related branches found
No related tags found
1 merge request!24Update module prometheus/common to v0.19.0
......@@ -11,7 +11,7 @@ require (
github.com/lpar/gzipped v1.1.1-0.20190413023519-5d9a18ea7f47
github.com/miekg/dns v1.1.40
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/common v0.18.0
github.com/prometheus/common v0.19.0
go.etcd.io/etcd v0.5.0-alpha.5.0.20190401205724-a621d807f061
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
......
......@@ -14,6 +14,7 @@
package model
import (
"encoding/json"
"fmt"
"math"
"regexp"
......@@ -254,6 +255,25 @@ func (d Duration) String() string {
return r
}
// MarshalJSON implements the json.Marshaler interface.
func (d Duration) MarshalJSON() ([]byte, error) {
return json.Marshal(d.String())
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (d *Duration) UnmarshalJSON(bytes []byte) error {
var s string
if err := json.Unmarshal(bytes, &s); err != nil {
return err
}
dur, err := ParseDuration(s)
if err != nil {
return err
}
*d = dur
return nil
}
// MarshalText implements the encoding.TextMarshaler interface.
func (d *Duration) MarshalText() ([]byte, error) {
return []byte(d.String()), nil
......
......@@ -88,7 +88,7 @@ github.com/prometheus/client_golang/prometheus/internal
github.com/prometheus/client_golang/prometheus/promhttp
# github.com/prometheus/client_model v0.2.0
github.com/prometheus/client_model/go
# github.com/prometheus/common v0.18.0
# github.com/prometheus/common v0.19.0
## explicit
github.com/prometheus/common/expfmt
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment