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

Function loadHTTPConfigJSONFile

config/http_config_test.go:1927–1937  ·  view source on GitHub ↗

loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.

(filename string)

Source from the content-addressed store, hash-verified

1925
1926// loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.
1927func loadHTTPConfigJSONFile(filename string) (*HTTPClientConfig, []byte, error) {
1928 content, err := os.ReadFile(filename)
1929 if err != nil {
1930 return nil, nil, err
1931 }
1932 cfg, err := loadHTTPConfigJSON(content)
1933 if err != nil {
1934 return nil, nil, err
1935 }
1936 return cfg, content, nil
1937}
1938
1939func TestProxyConfig_Proxy(t *testing.T) {
1940 var proxyServer *httptest.Server

Callers

nothing calls this directly

Calls 1

loadHTTPConfigJSONFunction · 0.85

Tested by

no test coverage detected