GetTotalDownloads returns the total download count across all releases
()
| 72 | |
| 73 | // GetTotalDownloads returns the total download count across all releases |
| 74 | func (c *GitHubClient) GetTotalDownloads() (int64, error) { |
| 75 | releases, err := c.GetReleases() |
| 76 | if err != nil { |
| 77 | return 0, err |
| 78 | } |
| 79 | |
| 80 | var total int64 |
| 81 | for _, release := range releases { |
| 82 | for _, asset := range release.Assets { |
| 83 | total += asset.DownloadCount |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | return total, nil |
| 88 | } |
| 89 | |
| 90 | // GetDownloadsByRelease returns download counts grouped by release |
| 91 | func (c *GitHubClient) GetDownloadsByRelease() ([]ReleaseDownloads, error) { |
no test coverage detected