LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
(s string)
| 307 | |
| 308 | // LoadHTTPConfig parses the YAML input s into a HTTPClientConfig. |
| 309 | func LoadHTTPConfig(s string) (*HTTPClientConfig, error) { |
| 310 | cfg := &HTTPClientConfig{} |
| 311 | err := yaml.UnmarshalStrict([]byte(s), cfg) |
| 312 | if err != nil { |
| 313 | return nil, err |
| 314 | } |
| 315 | return cfg, nil |
| 316 | } |
| 317 | |
| 318 | // LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig. |
| 319 | func LoadHTTPConfigFile(filename string) (*HTTPClientConfig, []byte, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…