Documentation ¶
Index ¶
- Variables
- func DeleteLabel(repoName string, id int, label string) error
- type Client
- func (c *Client) CanUserWriteToRepo(user git.User) (bool, error)
- func (c *Client) DeleteLabel(_ git.IssueType, id int, label string) error
- func (c *Client) DeleteWebhook(id int) error
- func (c *Client) GetBranch(branch string) (*git.Branch, error)
- func (c *Client) GetPullRequest(id int) (*git.PullRequest, error)
- func (c *Client) GetPullRequestDiff(id int) (*git.Diff, error)
- func (c *Client) GetUserInfo(userName string) (*git.User, error)
- func (c *Client) Init() error
- func (c *Client) ListComments(issueNo int) ([]git.IssueComment, error)
- func (c *Client) ListCommitStatuses(ref string) ([]git.CommitStatus, error)
- func (c *Client) ListLabels(id int) ([]git.IssueLabel, error)
- func (c *Client) ListPullRequestCommits(id int) ([]git.Commit, error)
- func (c *Client) ListPullRequests(_ bool) ([]git.PullRequest, error)
- func (c *Client) ListWebhook() ([]git.WebhookEntry, error)
- func (c *Client) MergePullRequest(id int, _ string, _ git.MergeMethod, message string) error
- func (c *Client) ParseWebhook(_ http.Header, _ []byte) (*git.Webhook, error)
- func (c *Client) RegisterComment(_ git.IssueType, issueNo int, sha, body string) error
- func (c *Client) RegisterWebhook(url string) error
- func (c *Client) SetCommitStatus(sha string, status git.CommitStatus) error
- func (c *Client) SetLabel(_ git.IssueType, id int, label string) error
- type Repo
Constants ¶
This section is empty.
Variables ¶
var ( Users map[string]*git.User Repos map[string]*Repo Branches map[string]*git.Branch )
Store as global variables - only for testing! test data should be able to be set from the outside
Functions ¶
Types ¶
type Client ¶
type Client struct { IntegrationConfig *cicdv1.IntegrationConfig K8sClient client.Client }
Client is a gitlab client struct
func (*Client) CanUserWriteToRepo ¶
CanUserWriteToRepo decides if the user has write permission on the repo
func (*Client) DeleteLabel ¶
DeleteLabel deletes label from the issue id
func (*Client) DeleteWebhook ¶
DeleteWebhook deletes registered webhook
func (*Client) GetPullRequest ¶
func (c *Client) GetPullRequest(id int) (*git.PullRequest, error)
GetPullRequest gets PR given id
func (*Client) GetPullRequestDiff ¶ added in v0.3.2
GetPullRequestDiff gets diff of the pull request
func (*Client) GetUserInfo ¶
GetUserInfo gets a user's information
func (*Client) ListComments ¶ added in v0.5.3
func (c *Client) ListComments(issueNo int) ([]git.IssueComment, error)
ListComments lists comments of the issue id
func (*Client) ListCommitStatuses ¶
func (c *Client) ListCommitStatuses(ref string) ([]git.CommitStatus, error)
ListCommitStatuses lists commit status of the specific commit
func (*Client) ListLabels ¶ added in v0.5.3
func (c *Client) ListLabels(id int) ([]git.IssueLabel, error)
ListLabels lists labels of pr id
func (*Client) ListPullRequestCommits ¶ added in v0.4.0
ListPullRequestCommits lists commits list of a pull request
func (*Client) ListPullRequests ¶
func (c *Client) ListPullRequests(_ bool) ([]git.PullRequest, error)
ListPullRequests gets pull request list
func (*Client) ListWebhook ¶
func (c *Client) ListWebhook() ([]git.WebhookEntry, error)
ListWebhook lists registered webhooks
func (*Client) MergePullRequest ¶
MergePullRequest merges a pull request
func (*Client) ParseWebhook ¶
ParseWebhook parses a webhook body for github
func (*Client) RegisterComment ¶
RegisterComment registers comment to an issue
func (*Client) RegisterWebhook ¶
RegisterWebhook registers our webhook server to the remote git server
func (*Client) SetCommitStatus ¶
func (c *Client) SetCommitStatus(sha string, status git.CommitStatus) error
SetCommitStatus sets commit status for the specific commit
type Repo ¶
type Repo struct { Webhooks map[int]*git.WebhookEntry UserCanWrite map[string]bool PullRequests map[int]*git.PullRequest PullRequestDiffs map[int]*git.Diff PullRequestCommits map[int][]git.Commit Commits map[string][]git.Commit CommitStatuses map[string][]git.CommitStatus Comments map[int][]git.IssueComment }
Repo is a repository storage