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

Function LoadHTTPConfig

config/http_config.go:265–272  ·  view source on GitHub ↗

LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.

(s string)

Source from the content-addressed store, hash-verified

263
264// LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
265func 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.
275func LoadHTTPConfigFile(filename string) (*HTTPClientConfig, []byte, error) {

Callers 1

LoadHTTPConfigFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected