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

Function loadHTTPConfigJSON

config/http_config_test.go:2509–2516  ·  view source on GitHub ↗

loadHTTPConfigJSON parses the JSON input s into a HTTPClientConfig.

(buf []byte)

Source from the content-addressed store, hash-verified

2507
2508// loadHTTPConfigJSON parses the JSON input s into a HTTPClientConfig.
2509func loadHTTPConfigJSON(buf []byte) (*HTTPClientConfig, error) {
2510 cfg := &HTTPClientConfig{}
2511 err := json.Unmarshal(buf, cfg)
2512 if err != nil {
2513 return nil, err
2514 }
2515 return cfg, nil
2516}
2517
2518// loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.
2519func loadHTTPConfigJSONFile(filename string) (*HTTPClientConfig, []byte, error) {

Callers 1

loadHTTPConfigJSONFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected