github

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

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

func NewGatewayForRepository(client *github.Client, repo *repo.Repo) *Gateway

NewGatewayForRepository builds a new GitHub gateway for the given GitHub repository.

func (*Gateway) DeleteBranch

func (g *Gateway) DeleteBranch(ctx context.Context, name string) error

DeleteBranch deletes the given remote branch.

func (*Gateway) GetBuildStatus added in v0.5.0

func (g *Gateway) GetBuildStatus(ctx context.Context, ref string) (*gateway.BuildStatus, error)

GetBuildStatus gets the build status for the given ref.

func (*Gateway) GetPullRequestPatch

func (g *Gateway) GetPullRequestPatch(ctx context.Context, number int) (string, error)

GetPullRequestPatch retrieves the raw patch for the given PR. The contents of the patch may be applied using the git-am command.

func (*Gateway) IsOwned

func (g *Gateway) IsOwned(ctx context.Context, br *github.PullRequestBranch) bool

IsOwned checks if this branch is local to this repository.

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

func (g *Gateway) SetPullRequestBase(ctx context.Context, number int, base string) error

SetPullRequestBase changes the merge base for the given PR.

func (*Gateway) SquashPullRequest

func (g *Gateway) SquashPullRequest(ctx context.Context, pr *github.PullRequest) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL