UnmarshalJSON implements the json.Marshaler interface for URL.
(data []byte)
| 406 | |
| 407 | // UnmarshalJSON implements the json.Marshaler interface for URL. |
| 408 | func (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. |
| 418 | func (a *BasicAuth) UnmarshalYAML(unmarshal func(interface{}) error) error { |