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

Function LoadHTTPConfig

config/http_config.go:307–314  ·  view source on GitHub ↗

LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.

(s string)

Source from the content-addressed store, hash-verified

305
306// LoadHTTPConfig parses the YAML input s into a HTTPClientConfig.
307func LoadHTTPConfig(s string) (*HTTPClientConfig, error) {
308 cfg := &HTTPClientConfig{}
309 err := yaml.UnmarshalStrict([]byte(s), cfg)
310 if err != nil {
311 return nil, err
312 }
313 return cfg, nil
314}
315
316// LoadHTTPConfigFile parses the given YAML file into a HTTPClientConfig.
317func LoadHTTPConfigFile(filename string) (*HTTPClientConfig, []byte, error) {

Callers 1

LoadHTTPConfigFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected