gitlab

package
v0.0.0-...-d01df85 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

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