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

Method UnmarshalJSON

config/http_config.go:477–484  ·  view source on GitHub ↗

UnmarshalJSON implements the json.Marshaler interface for URL.

(data []byte)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected