Documentation ¶
Overview ¶
Package github implements a client for GitHub that includes the minimum set of functions required by Hermit.
Index ¶
- func TokenAuthenticatedTransport(transport http.RoundTripper, token string) http.RoundTripper
- type Asset
- type Client
- func (a *Client) LatestRelease(repo string) (*Release, error)
- func (a *Client) PrepareDownload(asset Asset) (client *http.Client, req *http.Request, err error)
- func (a *Client) ProjectForURL(sourceURL string) string
- func (a *Client) Releases(repo string) (releases []Release, err error)
- func (a *Client) Repo(repo string) (*Repo, error)
- type Release
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenAuthenticatedTransport ¶
func TokenAuthenticatedTransport(transport http.RoundTripper, token string) http.RoundTripper
TokenAuthenticatedTransport returns a HTTP transport that will inject a GitHub authentication token into any requests to github.com.
Conceptually similar to https://github.com/google/go-github/blob/d23570d44313ca73dbcaadec71fc43eca4d29f8b/github/github.go#L841-L875
Types ¶
type Asset ¶
Asset is a minimal type for assets in the GitHub releases meta information retrieved via the GitHub API.
See https://docs.github.com/en/rest/reference/repos#list-releases
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for GitHub.
func (*Client) LatestRelease ¶
LatestRelease details for a GitHub repository.
func (*Client) PrepareDownload ¶
PrepareDownload prepares a HTTP client and request for retrieving a file from GitHub.
func (*Client) ProjectForURL ¶
ProjectForURL returns the <repo>/<project> for the given URL if it is a GitHub project.
type Release ¶
Release is a minimal type for GitHub releases meta information retrieved via the GitHub API.
See https://docs.github.com/en/rest/reference/repos#list-releases