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

Function loadHTTPConfigJSONFile

config/http_config_test.go:2519–2529  ·  view source on GitHub ↗

loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.

(filename string)

Source from the content-addressed store, hash-verified

2517
2518// loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.
2519func loadHTTPConfigJSONFile(filename string) (*HTTPClientConfig, []byte, error) {
2520 content, err := os.ReadFile(filename)
2521 if err != nil {
2522 return nil, nil, err
2523 }
2524 cfg, err := loadHTTPConfigJSON(content)
2525 if err != nil {
2526 return nil, nil, err
2527 }
2528 return cfg, content, nil
2529}
2530
2531func TestProxyConfig_Proxy(t *testing.T) {
2532 var proxyServer *httptest.Server

Callers

nothing calls this directly

Calls 1

loadHTTPConfigJSONFunction · 0.85

Tested by

no test coverage detected