Documentation
¶
Index ¶
- func NewGitHubSource(config source.Config) source.Source
- type GitHubInstance
- type GitHubReleaseApiResponse
- type GitHubReleaseAsset
- type GitHubSource
- func (s *GitHubSource) DownloadReleaseAsset(repo source.Repo, asset source.ReleaseAsset, destPath string, ...) error
- func (s *GitHubSource) DownloadSourceZip(repo source.Repo, gitRef string) (string, error)
- func (s *GitHubSource) FetchTags(repoUrl, token string) ([]string, error)
- func (s *GitHubSource) GetReleaseInfo(repo source.Repo, tag string) (source.Release, error)
- func (s *GitHubSource) MakeArchiveRequest(commit source.Commit, token string) (*http.Request, error)
- func (s *GitHubSource) ParseUrl(repoUrl, token string) (source.Repo, error)
- func (s *GitHubSource) Type() source.SourceType
- type GitHubTagsApiResponse
- type GitHubTagsCommitApiResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GitHubInstance ¶
GitHubInstance represents a GitHub instance (public or enterprise)
type GitHubReleaseApiResponse ¶
type GitHubReleaseApiResponse struct {
Id int `json:"id"`
Url string `json:"url"`
Name string `json:"name"`
Assets []GitHubReleaseAsset `json:"assets"`
}
GitHubReleaseApiResponse models GitHub API /repos/:owner/:repo/releases/tags/:tag response
type GitHubReleaseAsset ¶
type GitHubReleaseAsset struct {
Id int `json:"id"`
Url string `json:"url"`
Name string `json:"name"`
}
GitHubReleaseAsset models asset info in release response
type GitHubSource ¶
type GitHubSource struct {
// contains filtered or unexported fields
}
GitHubSource implements source.Source for GitHub
func (*GitHubSource) DownloadReleaseAsset ¶
func (s *GitHubSource) DownloadReleaseAsset(repo source.Repo, asset source.ReleaseAsset, destPath string, withProgress bool) error
DownloadReleaseAsset downloads a release asset to destPath
func (*GitHubSource) DownloadSourceZip ¶
DownloadSourceZip downloads repo archive for a git ref and returns temp file path
func (*GitHubSource) FetchTags ¶
func (s *GitHubSource) FetchTags(repoUrl, token string) ([]string, error)
FetchTags returns all semver tags from the repository
func (*GitHubSource) GetReleaseInfo ¶
GetReleaseInfo returns release information for a specific tag
func (*GitHubSource) MakeArchiveRequest ¶
func (s *GitHubSource) MakeArchiveRequest(commit source.Commit, token string) (*http.Request, error)
MakeArchiveRequest creates HTTP request to download repo archive
func (*GitHubSource) ParseUrl ¶
func (s *GitHubSource) ParseUrl(repoUrl, token string) (source.Repo, error)
ParseUrl parses a GitHub repo URL into a Repo struct
func (*GitHubSource) Type ¶
func (s *GitHubSource) Type() source.SourceType
Type returns the source type
type GitHubTagsApiResponse ¶
type GitHubTagsApiResponse struct {
Name string `json:"name"`
ZipBallUrl string `json:"zipball_url"`
TarballUrl string `json:"tarball_url"`
Commit GitHubTagsCommitApiResponse
}
GitHubTagsApiResponse models GitHub API /repos/:owner/:repo/tags response
type GitHubTagsCommitApiResponse ¶
GitHubTagsCommitApiResponse models commit info in tags response