github

package
v0.0.0-...-75ad633 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 11 Imported by: 0

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

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
}

Jump to

Keyboard shortcuts

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