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

Method UnmarshalJSON

config/http_config.go:475–482  ·  view source on GitHub ↗

UnmarshalJSON implements the json.Marshaler interface for URL.

(data []byte)

Source from the content-addressed store, hash-verified

473
474// UnmarshalJSON implements the json.Marshaler interface for URL.
475func (c *HTTPClientConfig) UnmarshalJSON(data []byte) error {
476 type plain HTTPClientConfig
477 *c = DefaultHTTPClientConfig
478 if err := json.Unmarshal(data, (*plain)(c)); err != nil {
479 return err
480 }
481 return c.Validate()
482}
483
484// UnmarshalYAML implements the yaml.Unmarshaler interface.
485func (a *BasicAuth) UnmarshalYAML(unmarshal func(any) error) error {

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected