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

Function loadHTTPConfigJSON

config/http_config_test.go:1917–1924  ·  view source on GitHub ↗

loadHTTPConfigJSON parses the JSON input s into a HTTPClientConfig.

(buf []byte)

Source from the content-addressed store, hash-verified

1915
1916// loadHTTPConfigJSON parses the JSON input s into a HTTPClientConfig.
1917func loadHTTPConfigJSON(buf []byte) (*HTTPClientConfig, error) {
1918 cfg := &HTTPClientConfig{}
1919 err := json.Unmarshal(buf, cfg)
1920 if err != nil {
1921 return nil, err
1922 }
1923 return cfg, nil
1924}
1925
1926// loadHTTPConfigJSONFile parses the given JSON file into a HTTPClientConfig.
1927func loadHTTPConfigJSONFile(filename string) (*HTTPClientConfig, []byte, error) {

Callers 1

loadHTTPConfigJSONFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected