Documentation ¶
Index ¶
- Constants
- type Commit
- type CommitFile
- type CommitImplementation
- type GitHub
- type Issue
- type IssueImplementation
- type NewPullRequestOptions
- type Options
- type PRImplementation
- type PullRequest
- func (pr *PullRequest) GetCommits(ctx context.Context) ([]*Commit, error)
- func (pr *PullRequest) GetMergeMode(ctx context.Context) (mode string, err error)
- func (pr *PullRequest) GetRebaseCommits(ctx context.Context) (commitSHAs []string, err error)
- func (pr *PullRequest) GetRepository(ctx context.Context) *Repository
- func (pr *PullRequest) PatchTreeID(ctx context.Context) (parentNr int, err error)
- type Repository
- func (repo *Repository) CreatePullRequest(ctx context.Context, head, base, title, body string, ...) (*PullRequest, error)
- func (repo *Repository) GetCommit(ctx context.Context, sha string) (c *Commit, err error)
- func (repo *Repository) GetPullRequest(ctx context.Context, number int) (pr *PullRequest, err error)
Constants ¶
View Source
const ( MMREBASE = "rebase" MMMERGE = "merge" MMSQUASH = "squash" )
View Source
const ( REBASE = "rebase" MERGE = "merge" SQUASH = "squash" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct { SHA string // SHA sum of the commit TreeSHA string // SHA of the commmit's tree Parents []string // SHAs of parent commits Files []CommitFile // List of files modified in this commit // contains filtered or unexported fields }
func (*Commit) ChangeTree ¶
ChangeTree creates a sha1 sum of the changed files
type CommitFile ¶
CommitFile abstracts a file changed in a commit
type CommitImplementation ¶
type CommitImplementation interface {
ChangeTree([]CommitFile) string
}
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
func NewWithOptions ¶
func (*GitHub) GetPullRequest ¶
func (gh *GitHub) GetPullRequest(ctx context.Context, owner, repo string, number int) (*PullRequest, error)
GetPullRequest fetches a PR from github
type IssueImplementation ¶
type IssueImplementation interface{}
type NewPullRequestOptions ¶
type NewPullRequestOptions struct {
MaintainerCanModify bool
}
type PRImplementation ¶
type PRImplementation interface {
// contains filtered or unexported methods
}
type PullRequest ¶
type PullRequest struct { Merged *bool MaintainerCanModify *bool MilestoneNumber *int64 MilestoneTitle *string CreatedAt time.Time RepoOwner string RepoName string FullName string Username string Ref string Sha string State string BuildStatus string BuildConclusion string BuildLink string URL string MergeCommitSHA string `db:"-"` Labels []string Number int Repository *Repository // contains filtered or unexported fields }
func NewPullRequest ¶
func NewPullRequest() *PullRequest
func (*PullRequest) GetCommits ¶
func (pr *PullRequest) GetCommits(ctx context.Context) ([]*Commit, error)
GetCommits returns the list of commits the pull request merged into its target branch
func (*PullRequest) GetMergeMode ¶
func (pr *PullRequest) GetMergeMode(ctx context.Context) (mode string, err error)
GetMergeMode returns a string describing the way the pull request was merged
func (*PullRequest) GetRebaseCommits ¶
func (pr *PullRequest) GetRebaseCommits(ctx context.Context) (commitSHAs []string, err error)
GetRebaseCommits returns the sequence of commits created when the PR was merged. It should only be used by rebased PRs.
func (*PullRequest) GetRepository ¶
func (pr *PullRequest) GetRepository(ctx context.Context) *Repository
GetRepository returns the Repository object representing the repo where the PR was filed
func (*PullRequest) PatchTreeID ¶
func (pr *PullRequest) PatchTreeID(ctx context.Context) (parentNr int, err error)
PatchTreeID return the parent ID of the pull request merge commit
type Repository ¶
type Repository struct { Owner string Name string BuildStatusContext string InstanceSetupScript string InstanceSetupUpgradeScript string JobName string GreetingTeam string // GreetingTeam is the GitHub team responsible for triaging non-member PRs for this repo. GreetingLabels []string // GreetingLabels are the labels applied automatically to non-member PRs for this repo. // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(owner, name string) *Repository
func (*Repository) CreatePullRequest ¶
func (repo *Repository) CreatePullRequest( ctx context.Context, head, base, title, body string, opts *NewPullRequestOptions, ) (*PullRequest, error)
CreatePullRequest creates a new pull request in the repository
func (*Repository) GetPullRequest ¶
func (repo *Repository) GetPullRequest(ctx context.Context, number int) (pr *PullRequest, err error)
Click to show internal directories.
Click to hide internal directories.