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) Download(asset Asset) (resp *http.Response, err error)
- func (a *Client) ETag(asset Asset) (etag string, err error)
- func (a *Client) LatestRelease(repo string) (*Release, error)
- func (a *Client) ProjectForURL(sourceURL string) string
- func (a *Client) Release(repo, tag string) (*Release, error)
- func (a *Client) Releases(repo string, limit int) (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) Download ¶ added in v0.3.3
Download creates a download request for retrieving a release asset from GitHub.
func (*Client) ETag ¶ added in v0.10.0
ETag issues a HEAD request for an Asset and returns its ETag.
func (*Client) LatestRelease ¶
LatestRelease details for a GitHub repository.
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