Documentation ¶
Index ¶
- Constants
- type GitlabClient
- func (gc *GitlabClient) AcceptMergeRequest(projectID string, mrID int) (*gitlab.MergeRequest, error)
- func (gc *GitlabClient) CloseMergeRequest(projectID string, mergeRequestIID int) error
- func (gc *GitlabClient) CreateBranch(projectID, newBranchName, defaultBranch string) error
- func (gc *GitlabClient) CreateFile(projectId, pathToFile, fileContent, branchName string) (*gitlab.FileInfo, error)
- func (gc *GitlabClient) CreateGitlabNewBranch(projectID, branchName, sha, baseBranch string) error
- func (gc *GitlabClient) DeleteBranch(projectID, branchName string) error
- func (gc *GitlabClient) DeleteWebhooks(projectID, clusterAppDomain string) error
- func (gc *GitlabClient) ExistsBranch(projectID, branchName string) (bool, error)
- func (gc *GitlabClient) GetClient() *gitlabClient.Client
- func (gc *GitlabClient) GetFileMetaData(projectID, pathToFile, branchName string) (*gitlab.File, error)
- func (gc *GitlabClient) GetMergeRequests() ([]*gitlab.MergeRequest, error)
- func (gc *GitlabClient) ValidateNoteInMergeRequestComment(projectID, expectedNote string, mergeRequestID int)
Constants ¶
const (
HEADS = "refs/heads/%s"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitlabClient ¶
type GitlabClient struct {
// contains filtered or unexported fields
}
func NewGitlabClient ¶
func NewGitlabClient(accessToken, baseUrl string) (*GitlabClient, error)
func (*GitlabClient) AcceptMergeRequest ¶
func (gc *GitlabClient) AcceptMergeRequest(projectID string, mrID int) (*gitlab.MergeRequest, error)
func (*GitlabClient) CloseMergeRequest ¶
func (gc *GitlabClient) CloseMergeRequest(projectID string, mergeRequestIID int) error
CloseMergeRequest closes merge request in Gitlab repo by given MR IID
func (*GitlabClient) CreateBranch ¶
func (gc *GitlabClient) CreateBranch(projectID, newBranchName, defaultBranch string) error
CreateBranch creates a new branch in a GitLab project with the given projectID and newBranchName
func (*GitlabClient) CreateFile ¶
func (gc *GitlabClient) CreateFile(projectId, pathToFile, fileContent, branchName string) (*gitlab.FileInfo, error)
func (*GitlabClient) CreateGitlabNewBranch ¶
func (gc *GitlabClient) CreateGitlabNewBranch(projectID, branchName, sha, baseBranch string) error
CreateGitlabNewBranch creates a new branch
func (*GitlabClient) DeleteBranch ¶
func (gc *GitlabClient) DeleteBranch(projectID, branchName string) error
DeleteBranch deletes a branch by its name and project ID
func (*GitlabClient) DeleteWebhooks ¶
func (gc *GitlabClient) DeleteWebhooks(projectID, clusterAppDomain string) error
DeleteWebhooks deletes webhooks in Gitlab repo by given project ID, and if the webhook URL contains the cluster's domain name.
func (*GitlabClient) ExistsBranch ¶
func (gc *GitlabClient) ExistsBranch(projectID, branchName string) (bool, error)
ExistsBranch checks if a branch exists in a specified GitLab repository.
func (*GitlabClient) GetClient ¶
func (gc *GitlabClient) GetClient() *gitlabClient.Client
GetClient returns the underlying gitlab client
func (*GitlabClient) GetFileMetaData ¶
func (gc *GitlabClient) GetFileMetaData(projectID, pathToFile, branchName string) (*gitlab.File, error)
func (*GitlabClient) GetMergeRequests ¶
func (gc *GitlabClient) GetMergeRequests() ([]*gitlab.MergeRequest, error)
GetMergeRequests returns a list of all MergeRequests in a given project ID and repository name
func (*GitlabClient) ValidateNoteInMergeRequestComment ¶
func (gc *GitlabClient) ValidateNoteInMergeRequestComment(projectID, expectedNote string, mergeRequestID int)
ValidateNoteInMergeRequestComment verify expected note is commented in MR comment