Documentation
¶
Index ¶
- Variables
- func GHLogin(hostname string) (string, error)
- func GetGitHubToken(cfg config.Containable) (string, error)
- func NewReleaseProvider(client GitHubClient) release.Provider
- type GHClient
- func (c *GHClient) AddLabelsToPullRequest(ctx context.Context, owner, repo string, number int, labels []string) error
- func (c *GHClient) CreatePullRequest(ctx context.Context, owner string, repo string, pr *github.NewPullRequest) (*github.PullRequest, error)
- func (c *GHClient) CreateRepo(ctx context.Context, owner, slug string) (*github.Repository, error)
- func (c *GHClient) DownloadAsset(ctx context.Context, owner, repo string, assetID int64) (io.ReadCloser, error)
- func (c *GHClient) DownloadAssetTo(ctx context.Context, fs afero.Fs, owner, repo string, assetID int64, ...) error
- func (c *GHClient) GetClient() *github.Client
- func (c *GHClient) GetFileContents(ctx context.Context, owner, repo, path, ref string) (string, error)
- func (c *GHClient) GetPullRequestByBranch(ctx context.Context, owner, repo, branch, state string) (*github.PullRequest, error)
- func (c *GHClient) GetReleaseAssetID(ctx context.Context, owner, repo, tag, assetName string) (int64, error)
- func (c *GHClient) GetReleaseAssets(ctx context.Context, owner, repo, tag string) ([]*github.ReleaseAsset, error)
- func (c *GHClient) ListReleases(ctx context.Context, owner, repo string) ([]string, error)
- func (c *GHClient) UpdatePullRequest(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)
- func (c *GHClient) UploadKey(ctx context.Context, name string, key []byte) error
- type GitHubClient
- type GitHubReleaseProvider
- func (p *GitHubReleaseProvider) DownloadReleaseAsset(ctx context.Context, owner, repo string, asset release.ReleaseAsset) (io.ReadCloser, string, error)
- func (p *GitHubReleaseProvider) GetLatestRelease(ctx context.Context, owner, repo string) (release.Release, error)
- func (p *GitHubReleaseProvider) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (release.Release, error)
- func (p *GitHubReleaseProvider) ListReleases(ctx context.Context, owner, repo string, limit int) ([]release.Release, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPullRequestFound = errors.New("no pull request found") ErrRepoExists = errors.New("repository already exists") )
Functions ¶
func GetGitHubToken ¶
func GetGitHubToken(cfg config.Containable) (string, error)
func NewReleaseProvider ¶
func NewReleaseProvider(client GitHubClient) release.Provider
Types ¶
type GHClient ¶
func NewGitHubClient ¶
func NewGitHubClient(cfg config.Containable) (*GHClient, error)
func (*GHClient) AddLabelsToPullRequest ¶
func (*GHClient) CreatePullRequest ¶
func (c *GHClient) CreatePullRequest(ctx context.Context, owner string, repo string, pr *github.NewPullRequest) (*github.PullRequest, error)
func (*GHClient) CreateRepo ¶
func (*GHClient) DownloadAsset ¶
func (*GHClient) DownloadAssetTo ¶
func (*GHClient) GetFileContents ¶
func (*GHClient) GetPullRequestByBranch ¶
func (*GHClient) GetReleaseAssetID ¶
func (*GHClient) GetReleaseAssets ¶
func (*GHClient) ListReleases ¶
func (*GHClient) UpdatePullRequest ¶
type GitHubClient ¶
type GitHubClient interface {
GetClient() *github.Client
CreatePullRequest(ctx context.Context, owner string, repo string, pull *github.NewPullRequest) (*github.PullRequest, error)
GetPullRequestByBranch(ctx context.Context, owner, repo, branch, state string) (*github.PullRequest, error)
AddLabelsToPullRequest(ctx context.Context, owner, repo string, number int, labels []string) error
UpdatePullRequest(ctx context.Context, owner, repo string, number int, pull *github.PullRequest) (*github.PullRequest, *github.Response, error)
CreateRepo(ctx context.Context, owner, slug string) (*github.Repository, error)
UploadKey(ctx context.Context, name string, key []byte) error
ListReleases(ctx context.Context, owner, repo string) ([]string, error)
GetReleaseAssets(ctx context.Context, owner, repo, tag string) ([]*github.ReleaseAsset, error)
GetReleaseAssetID(ctx context.Context, owner, repo, tag, assetName string) (int64, error)
DownloadAsset(ctx context.Context, owner, repo string, assetID int64) (io.ReadCloser, error)
DownloadAssetTo(ctx context.Context, fs afero.Fs, owner, repo string, assetID int64, filePath string) error
GetFileContents(ctx context.Context, owner, repo, path, ref string) (string, error)
}
type GitHubReleaseProvider ¶
type GitHubReleaseProvider struct {
// contains filtered or unexported fields
}
GitHubReleaseProvider implements release.Provider.
func (*GitHubReleaseProvider) DownloadReleaseAsset ¶
func (p *GitHubReleaseProvider) DownloadReleaseAsset(ctx context.Context, owner, repo string, asset release.ReleaseAsset) (io.ReadCloser, string, error)
func (*GitHubReleaseProvider) GetLatestRelease ¶
func (*GitHubReleaseProvider) GetReleaseByTag ¶
func (*GitHubReleaseProvider) ListReleases ¶
Click to show internal directories.
Click to hide internal directories.