SelectedRepositoryCount returns how many repositories the variable is visible to, fetched from the given entrusted URL. Callers own reading the URL off the variable and writing the result back.
(apiClient *api.Client, host string, selectedReposURL safeurl.SafeURL)
| 69 | // SelectedRepositoryCount returns how many repositories the variable is visible to, fetched from the |
| 70 | // given entrusted URL. Callers own reading the URL off the variable and writing the result back. |
| 71 | func SelectedRepositoryCount(apiClient *api.Client, host string, selectedReposURL safeurl.SafeURL) (int, error) { |
| 72 | response := struct { |
| 73 | TotalCount int `json:"total_count"` |
| 74 | }{} |
| 75 | if err := apiClient.REST(host, "GET", selectedReposURL.String(), nil, &response); err != nil { |
| 76 | return 0, err |
| 77 | } |
| 78 | return response.TotalCount, nil |
| 79 | } |
no test coverage detected