(tunnelID uuid.UUID)
| 214 | } |
| 215 | |
| 216 | func (r *RESTClient) ListActiveClients(tunnelID uuid.UUID) ([]*ActiveClient, error) { |
| 217 | endpoint := r.baseEndpoints.accountLevel |
| 218 | endpoint.Path = path.Join(endpoint.Path, fmt.Sprintf("%v/connections", tunnelID)) |
| 219 | resp, err := r.sendRequest("GET", endpoint, nil) |
| 220 | if err != nil { |
| 221 | return nil, errors.Wrap(err, "REST request failed") |
| 222 | } |
| 223 | defer resp.Body.Close() |
| 224 | |
| 225 | if resp.StatusCode == http.StatusOK { |
| 226 | return parseConnectionsDetails(resp.Body) |
| 227 | } |
| 228 | |
| 229 | return nil, r.statusCodeToError("list connection details", resp) |
| 230 | } |
| 231 | |
| 232 | func parseConnectionsDetails(reader io.Reader) ([]*ActiveClient, error) { |
| 233 | var clients []*ActiveClient |
nothing calls this directly
no test coverage detected