Documentation ¶
Overview ¶
Package github provides all functionality to interact with github in point of view of gotrap. This includes getting the commit status of a merge request or create a new merge request.
Index ¶
- type GithubClient
- func (c GithubClient) AddCommentToPullRequest(pr *github.PullRequest, message string) (bool, error)
- func (c GithubClient) ClosePullRequest(pr *github.PullRequest) (bool, error)
- func (c GithubClient) CreatePullRequestForPatchset(m *gerrit.Message) (*github.PullRequest, error)
- func (c GithubClient) WaitUntilCommitStatusIsAvailable(pr github.PullRequest) (*github.CombinedStatus, error)
- type PullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GithubClient ¶
type GithubClient struct { Client *github.Client Conf *config.GithubConfiguration }
GithubClient is the main data structure to interact with github. Client is to interact with github itself. Conf contains the github configuration.
func NewGithubClient ¶
func NewGithubClient(conf *config.GithubConfiguration) *GithubClient
NewGithubClient will return a client to interact with Github. As an argument the github part of the configuration is necessary.
func (GithubClient) AddCommentToPullRequest ¶
func (c GithubClient) AddCommentToPullRequest(pr *github.PullRequest, message string) (bool, error)
func (GithubClient) ClosePullRequest ¶
func (c GithubClient) ClosePullRequest(pr *github.PullRequest) (bool, error)
func (GithubClient) CreatePullRequestForPatchset ¶
func (c GithubClient) CreatePullRequestForPatchset(m *gerrit.Message) (*github.PullRequest, error)
createPullRequestForPatchset will create a new Pull Request at Github All information (like base and target branch) are received by the message by Gerrit
func (GithubClient) WaitUntilCommitStatusIsAvailable ¶
func (c GithubClient) WaitUntilCommitStatusIsAvailable(pr github.PullRequest) (*github.CombinedStatus, error)
waitUntilCommitStatusIsAvailable checks if an external service (like TravisCI) already finished the process and reports back via the Github Commit Status API
type PullRequest ¶
type PullRequest struct { PullRequest *github.PullRequest CombinedStatus *github.CombinedStatus }