MCPcopy
hub / github.com/cortexlabs/cortex / operatorRequest

Function operatorRequest

cli/cluster/lib_http_client.go:156–171  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, method string, endpoint string, body io.Reader, qParams ...map[string]string)

Source from the content-addressed store, hash-verified

154}
155
156func operatorRequest(operatorConfig OperatorConfig, method string, endpoint string, body io.Reader, qParams ...map[string]string) (*http.Request, error) {
157 req, err := http.NewRequest(method, operatorConfig.OperatorEndpoint+endpoint, body)
158 if err != nil {
159 return nil, errors.Wrap(err, _errStrCantMakeRequest)
160 }
161
162 values := req.URL.Query()
163 for _, paramMap := range qParams {
164 for key, value := range paramMap {
165 values.Set(key, value)
166 }
167 }
168 req.URL.RawQuery = values.Encode()
169
170 return req, nil
171}
172
173func makeOperatorRequest(operatorConfig OperatorConfig, request *http.Request) ([]byte, error) {
174 if operatorConfig.Telemetry {

Callers 6

streamLogsFunction · 0.85
HTTPGetFunction · 0.85
HTTPPostJSONFunction · 0.85
HTTPPostNoBodyFunction · 0.85
HTTPDeleteFunction · 0.85
HTTPUploadFunction · 0.85

Calls 2

WrapFunction · 0.92
SetMethod · 0.80

Tested by

no test coverage detected