ghds

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(dss DownloadStatsService) (string, error)

Types

type DownloadStatsService

type DownloadStatsService interface {
	FetchReleaseHistory() (*ReleaseHistory, error)
	FormatDownloadStats(*ReleaseHistory) (string, error)
}

type GitHubDownloadStatsOptions

type GitHubDownloadStatsOptions struct {
	Release     string
	JsonOut     bool
	ApiEndpoint string
	Token       string
	PreRelease  bool
}

type GitHubDownloadStatsService

type GitHubDownloadStatsService struct {
	// contains filtered or unexported fields
}

func NewGitHubDownloadStatsService

func NewGitHubDownloadStatsService(owner string, repo string, options *GitHubDownloadStatsOptions) *GitHubDownloadStatsService

func (*GitHubDownloadStatsService) FetchReleaseHistory

func (ghds *GitHubDownloadStatsService) FetchReleaseHistory() (*ReleaseHistory, error)

func (*GitHubDownloadStatsService) FormatDownloadStats

func (ghds *GitHubDownloadStatsService) FormatDownloadStats(history *ReleaseHistory) (string, error)

type Release

type Release struct {
	Name           string         `json:"name"`
	Date           time.Time      `json:"date"`
	Assets         []ReleaseAsset `json:"assets"`
	TotalDownloads int            `json:"total_downloads"`
}

type ReleaseAsset

type ReleaseAsset struct {
	Name      string `json:"name"`
	Downloads int    `json:"download_count"`
}

type ReleaseHistory

type ReleaseHistory struct {
	Repository   string    `json:"repository"`
	Releases     []Release `json:"releases"`
	ReleaseCount int       `json:"release_count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL