MCPcopy Create free account
hub / github.com/prometheus/common / UnmarshalJSON

Method UnmarshalJSON

config/http_config.go:408–415  ·  view source on GitHub ↗

UnmarshalJSON implements the json.Marshaler interface for URL.

(data []byte)

Source from the content-addressed store, hash-verified

406
407// UnmarshalJSON implements the json.Marshaler interface for URL.
408func (c *HTTPClientConfig) UnmarshalJSON(data []byte) error {
409 type plain HTTPClientConfig
410 *c = DefaultHTTPClientConfig
411 if err := json.Unmarshal(data, (*plain)(c)); err != nil {
412 return err
413 }
414 return c.Validate()
415}
416
417// UnmarshalYAML implements the yaml.Unmarshaler interface.
418func (a *BasicAuth) UnmarshalYAML(unmarshal func(interface{}) error) error {

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected