LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
(s string)
| 263 | |
| 264 | // LoadHTTPConfig parses the YAML input s into a HTTPClientConfig. |
| 265 | func LoadHTTPConfig(s string) (*HTTPClientConfig, error) { |
| 266 | cfg := &HTTPClientConfig{} |
| 267 | err := yaml.UnmarshalStrict([]byte(s), cfg) |
| 268 | if err != nil { |
| 269 | return nil, err |
| 270 | } |
| 271 | return cfg, nil |
| 272 | } |
| 273 | |
| 274 | // LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig. |
| 275 | func LoadHTTPConfigFile(filename string) (*HTTPClientConfig, []byte, error) { |
no outgoing calls
no test coverage detected