UnmarshalJSON implements the json.Marshaler interface for URL.
(data []byte)
| 245 | |
| 246 | // UnmarshalJSON implements the json.Marshaler interface for URL. |
| 247 | func (o *OAuth2) UnmarshalJSON(data []byte) error { |
| 248 | type plain OAuth2 |
| 249 | if err := json.Unmarshal(data, (*plain)(o)); err != nil { |
| 250 | return err |
| 251 | } |
| 252 | return o.ProxyConfig.Validate() |
| 253 | } |
| 254 | |
| 255 | // SetDirectory joins any relative file paths with dir. |
| 256 | func (a *OAuth2) SetDirectory(dir string) { |