(operatorConfig OperatorConfig, method string, endpoint string, body io.Reader, qParams ...map[string]string)
| 154 | } |
| 155 | |
| 156 | func 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 | |
| 173 | func makeOperatorRequest(operatorConfig OperatorConfig, request *http.Request) ([]byte, error) { |
| 174 | if operatorConfig.Telemetry { |
no test coverage detected