DeleteRoute calls the Tunnelstore DELETE endpoint for a given route.
(id uuid.UUID)
| 176 | |
| 177 | // DeleteRoute calls the Tunnelstore DELETE endpoint for a given route. |
| 178 | func (r *RESTClient) DeleteRoute(id uuid.UUID) error { |
| 179 | endpoint := r.baseEndpoints.accountRoutes |
| 180 | endpoint.Path = path.Join(endpoint.Path, url.PathEscape(id.String())) |
| 181 | |
| 182 | resp, err := r.sendRequest("DELETE", endpoint, nil) |
| 183 | if err != nil { |
| 184 | return errors.Wrap(err, "REST request failed") |
| 185 | } |
| 186 | defer resp.Body.Close() |
| 187 | |
| 188 | if resp.StatusCode == http.StatusOK { |
| 189 | _, err := parseRoute(resp.Body) |
| 190 | return err |
| 191 | } |
| 192 | |
| 193 | return r.statusCodeToError("delete route", resp) |
| 194 | } |
| 195 | |
| 196 | // GetByIP checks which route will proxy a given IP. |
| 197 | func (r *RESTClient) GetByIP(params GetRouteByIpParams) (DetailedRoute, error) { |
nothing calls this directly
no test coverage detected