ghds

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 9 Imported by: 0

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
}

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