gitlab

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gitlab provides GitLab API client operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a GitLab API client wrapper.

func NewClient

func NewClient() (*Client, error)

NewClient creates a new GitLab client.

func (*Client) ApproveMergeRequest

func (c *Client) ApproveMergeRequest(mrIID int) error

ApproveMergeRequest approves a merge request.

func (*Client) CreateMergeRequest

func (c *Client) CreateMergeRequest(
	sourceBranch, targetBranch, title, description, assignee, reviewer string,
	labels []string, squash bool,
) (*gitlab.MergeRequest, error)

CreateMergeRequest creates a new merge request with assignees, reviewers, and labels.

func (*Client) GetMergeRequestByBranch

func (c *Client) GetMergeRequestByBranch(sourceBranch, targetBranch string) (*gitlab.MergeRequest, error)

GetMergeRequestByBranch fetches an existing merge request by source and target branches.

func (*Client) GetMergeRequestsByBranch

func (c *Client) GetMergeRequestsByBranch(sourceBranch string) ([]*gitlab.BasicMergeRequest, error)

GetMergeRequestsByBranch returns all open merge requests for the given source branch.

func (*Client) ListLabels

func (c *Client) ListLabels() ([]*Label, error)

ListLabels returns all labels for the project.

func (*Client) MergeMergeRequest

func (c *Client) MergeMergeRequest(mrIID int, squash bool) error

MergeMergeRequest merges a merge request.

func (*Client) SetLogger

func (c *Client) SetLogger(logger *bullets.Logger)

SetLogger sets the logger for the GitLab client.

func (*Client) SetProjectFromURL

func (c *Client) SetProjectFromURL(url string) error

SetProjectFromURL sets the project from a git remote URL.

func (*Client) WaitForPipeline

func (c *Client) WaitForPipeline(timeout time.Duration) (string, error)

WaitForPipeline waits for all pipelines to complete for the merge request.

type Label

type Label struct {
	Name string
}

Label represents a GitLab label.

Jump to

Keyboard shortcuts

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