Documentation
¶
Index ¶
- type Gateway
- func (g *Gateway) DeleteBranch(ctx context.Context, name string) error
- func (g *Gateway) GetBuildStatus(ctx context.Context, ref string) (*gateway.BuildStatus, error)
- func (g *Gateway) GetPullRequestPatch(ctx context.Context, number int) (string, error)
- func (g *Gateway) IsOwned(ctx context.Context, br *github.PullRequestBranch) bool
- func (g *Gateway) ListPullRequestReviews(ctx context.Context, number int) ([]*gateway.PullRequestReview, error)
- func (g *Gateway) ListPullRequestsByBase(ctx context.Context, branch string) ([]*github.PullRequest, error)
- func (g *Gateway) ListPullRequestsByHead(ctx context.Context, owner, branch string) ([]*github.PullRequest, error)
- func (g *Gateway) SetPullRequestBase(ctx context.Context, number int, base string) error
- func (g *Gateway) SquashPullRequest(ctx context.Context, pr *github.PullRequest) error
- type GitService
- type PullRequestsService
- type RepositoriesService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is a GitHub gateway that makes actual requests to GitHub.
func NewGatewayForRepository ¶
NewGatewayForRepository builds a new GitHub gateway for the given GitHub repository.
func (*Gateway) DeleteBranch ¶
DeleteBranch deletes the given remote branch.
func (*Gateway) GetBuildStatus ¶ added in v0.5.0
GetBuildStatus gets the build status for the given ref.
func (*Gateway) GetPullRequestPatch ¶
GetPullRequestPatch retrieves the raw patch for the given PR. The contents of the patch may be applied using the git-am command.
func (*Gateway) ListPullRequestReviews ¶ added in v0.5.0
func (g *Gateway) ListPullRequestReviews(ctx context.Context, number int) ([]*gateway.PullRequestReview, error)
ListPullRequestReviews lists reviews for a pull request.
func (*Gateway) ListPullRequestsByBase ¶
func (g *Gateway) ListPullRequestsByBase(ctx context.Context, branch string) ([]*github.PullRequest, error)
ListPullRequestsByBase lists pull requests made against the given merge base.
func (*Gateway) ListPullRequestsByHead ¶
func (g *Gateway) ListPullRequestsByHead(ctx context.Context, owner, branch string) ([]*github.PullRequest, error)
ListPullRequestsByHead lists pull requests with the given head.
func (*Gateway) SetPullRequestBase ¶
SetPullRequestBase changes the merge base for the given PR.
func (*Gateway) SquashPullRequest ¶
SquashPullRequest merges given pull request. The title and description are used as-is for the commit message.
type GitService ¶ added in v0.5.0
type GitService interface {
DeleteRef(
ctx context.Context,
owner string, repo string, ref string,
) (*github.Response, error)
}
GitService is a subset of the GitHub Git API.
type PullRequestsService ¶ added in v0.5.0
type PullRequestsService interface {
Edit(
ctx context.Context,
owner string, repo string, number int,
pull *github.PullRequest,
) (*github.PullRequest, *github.Response, error)
GetRaw(
ctx context.Context,
owner string, repo string, number int, opt github.RawOptions,
) (string, *github.Response, error)
List(
ctx context.Context,
owner string, repo string, opt *github.PullRequestListOptions,
) ([]*github.PullRequest, *github.Response, error)
ListReviews(
ctx context.Context,
owner, repo string, number int,
) ([]*github.PullRequestReview, *github.Response, error)
Merge(
ctx context.Context,
owner string, repo string, number int,
commitMessage string,
options *github.PullRequestOptions,
) (*github.PullRequestMergeResult, *github.Response, error)
}
PullRequestsService is a subset of the GitHub Pull Requests API.
type RepositoriesService ¶ added in v0.5.0
type RepositoriesService interface {
GetCombinedStatus(ctx context.Context,
owner, repo, ref string, opt *github.ListOptions,
) (*github.CombinedStatus, *github.Response, error)
}
RepositoriesService is a subset of the GitHub Repositories API.