Documentation
¶
Index ¶
- Variables
- func APICacheFilePath(cacheDir, rawURL string) string
- func CacheFilePath(cacheDir, rawURL string) string
- func Download(rawURL string, out io.Writer, getbar func(size int64) *pb.ProgressBar, ...) error
- func Get(rawURL string, disableSSL bool) (*http.Response, error)
- func GetWithOptions(rawURL string, opts Options) (*http.Response, error)
- func ProxyFuncFor(proxyURL string) (func(*http.Request) (*url.URL, error), error)
- func SetAPICacheNoticeWriter(writer io.Writer) io.Writer
- func SetDownloadGetWithOptionsForTest(fn func(url string, opts Options) (*http.Response, error)) func()
- func SetHTTPDoForTest(fn func(client *http.Client, req *http.Request) (*http.Response, error)) func()
- func SetProxyNoticeWriter(writer io.Writer) io.Writer
- func SetVerbose(enabled bool, writer io.Writer)
- func VerboseEnabledForTest() bool
- func Verbosef(format string, args ...any)
- type Asset
- type GitHubClient
- func (c *GitHubClient) Get(rawURL string) (*http.Response, error)
- func (c *GitHubClient) LatestRelease(repo string, includePrerelease bool) (Release, error)
- func (c *GitHubClient) LatestReleaseInfo(repo string) (string, time.Time, error)
- func (c *GitHubClient) ListReleases(repo string, limit int, includePrerelease bool) ([]Release, error)
- func (c *GitHubClient) ReleaseAssets(repo, tag string) ([]Asset, error)
- func (c *GitHubClient) RepoInfo(repo string) (RepoInfo, error)
- func (c *GitHubClient) SearchRepositories(query string, limit int, sort, order string) (SearchResult, error)
- type HTTPGetFunc
- type HTTPGetterFunc
- type Options
- type RateLimit
- type RateLimitJSON
- type Release
- type RepoInfo
- type SearchRepo
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoToken = errors.New("no github token")
Functions ¶
func APICacheFilePath ¶
func CacheFilePath ¶
func ProxyFuncFor ¶
func SetHTTPDoForTest ¶
func SetVerbose ¶
func VerboseEnabledForTest ¶
func VerboseEnabledForTest() bool
Types ¶
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(opts Options) *GitHubClient
func NewGitHubClientWithGetter ¶
func NewGitHubClientWithGetter(opts Options, get HTTPGetFunc) *GitHubClient
func (*GitHubClient) LatestRelease ¶
func (c *GitHubClient) LatestRelease(repo string, includePrerelease bool) (Release, error)
func (*GitHubClient) LatestReleaseInfo ¶
func (*GitHubClient) ListReleases ¶
func (*GitHubClient) ReleaseAssets ¶
func (c *GitHubClient) ReleaseAssets(repo, tag string) ([]Asset, error)
func (*GitHubClient) SearchRepositories ¶
func (c *GitHubClient) SearchRepositories(query string, limit int, sort, order string) (SearchResult, error)
type HTTPGetterFunc ¶
func NewHTTPGetter ¶
func NewHTTPGetter(opts Options) HTTPGetterFunc
type RateLimit ¶
type RateLimit struct {
Limit int `json:"limit"`
Remaining int `json:"remaining"`
Reset int64 `json:"reset"`
}
func GetRateLimit ¶
type RateLimitJSON ¶
type RepoInfo ¶
type RepoInfo struct {
Repo string `json:"repo"`
Description string `json:"description,omitempty"`
Homepage string `json:"homepage,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
Stars int `json:"stars,omitempty"`
Forks int `json:"forks,omitempty"`
OpenIssues int `json:"open_issues,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
type SearchRepo ¶
type SearchRepo struct {
FullName string `json:"full_name,omitempty"`
Description string `json:"description,omitempty"`
HTMLURL string `json:"html_url,omitempty"`
Homepage string `json:"homepage,omitempty"`
Language string `json:"language,omitempty"`
StargazersCount int `json:"stargazers_count,omitempty"`
ForksCount int `json:"forks_count,omitempty"`
OpenIssuesCount int `json:"open_issues_count,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Archived bool `json:"archived,omitempty"`
Private bool `json:"private,omitempty"`
}
type SearchResult ¶
type SearchResult struct {
Query string `json:"query"`
TotalCount int `json:"total_count"`
Items []SearchRepo `json:"items,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.