MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / runDownloads

Function runDownloads

cmd/playconsole-cli/commands/stats/stats.go:67–98  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

65}
66
67func runDownloads(cmd *cobra.Command, args []string) error {
68 client := api.NewGitHubClient()
69
70 if byPlatform {
71 platforms, _, err := client.GetDownloadsByPlatform()
72 if err != nil {
73 return fmt.Errorf("failed to fetch platform stats: %w", err)
74 }
75 return output.Print(platforms)
76 }
77
78 if byRelease {
79 releases, err := client.GetDownloadsByRelease()
80 if err != nil {
81 return fmt.Errorf("failed to fetch release stats: %w", err)
82 }
83 return output.Print(releases)
84 }
85
86 // Default: show summary
87 total, err := client.GetTotalDownloads()
88 if err != nil {
89 return fmt.Errorf("failed to fetch download stats: %w", err)
90 }
91
92 stats := DownloadStats{
93 Total: total,
94 LastUpdated: time.Now().UTC().Format(time.RFC3339),
95 }
96
97 return output.Print(stats)
98}
99
100func runSources(cmd *cobra.Command, args []string) error {
101 sources := []DownloadSource{

Callers

nothing calls this directly

Calls 5

GetDownloadsByReleaseMethod · 0.95
GetTotalDownloadsMethod · 0.95
NewGitHubClientFunction · 0.92
PrintFunction · 0.92

Tested by

no test coverage detected