gitlab

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUserAvailable

func IsUserAvailable(status *UserStatus, oooKeywords []string) bool

IsUserAvailable checks if a user is available based on their status.

func ParseCodeowners

func ParseCodeowners(content string) map[string][]string

ParseCodeowners parses a CODEOWNERS file content and returns a map of patterns to owners.

Types

type Client

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

Client wraps the GitLab API client.

func NewClient

func NewClient(cfg *config.GitLabConfig, log *logger.Logger) (*Client, error)

NewClient creates a new GitLab client.

func (*Client) GetCodeowners

func (c *Client) GetCodeowners(projectID int, ref string) (string, error)

GetCodeowners retrieves the CODEOWNERS file content.

func (*Client) GetGroupByPath

func (c *Client) GetGroupByPath(path string) (*gitlab.Group, error)

GetGroupByPath retrieves a GitLab group by its path.

func (*Client) GetGroupMembers

func (c *Client) GetGroupMembers(groupID int) ([]*gitlab.GroupMember, error)

GetGroupMembers retrieves all members of a GitLab group.

func (*Client) GetGroupProjects

func (c *Client) GetGroupProjects(groupID int) ([]*gitlab.Project, error)

GetGroupProjects retrieves all projects in a GitLab group.

func (*Client) GetMergeRequest

func (c *Client) GetMergeRequest(projectID, mrIID int) (*gitlab.MergeRequest, error)

GetMergeRequest retrieves a merge request.

func (*Client) GetMergeRequestApprovals

func (c *Client) GetMergeRequestApprovals(projectID, mrIID int) (*gitlab.MergeRequestApprovals, error)

GetMergeRequestApprovals retrieves approval information for a merge request.

func (*Client) GetMergeRequestChanges

func (c *Client) GetMergeRequestChanges(projectID, mrIID int) ([]*gitlab.MergeRequestDiff, error)

GetMergeRequestChanges retrieves the file changes in a merge request.

func (*Client) GetMergeRequestNotes

func (c *Client) GetMergeRequestNotes(projectID, mrIID int) ([]*gitlab.Note, error)

GetMergeRequestNotes retrieves all notes (comments) for a merge request.

func (*Client) GetOpenMergeRequests

func (c *Client) GetOpenMergeRequests(projectID, maxMRs int) ([]*gitlab.BasicMergeRequest, error)

GetOpenMergeRequests retrieves open merge requests from a project.

func (*Client) GetProjectLabels

func (c *Client) GetProjectLabels(projectID int) ([]*gitlab.Label, error)

GetProjectLabels retrieves all labels for a project.

func (*Client) GetProjectMembers

func (c *Client) GetProjectMembers(projectID int) ([]*gitlab.ProjectMember, error)

GetProjectMembers retrieves all members of a GitLab project.

func (*Client) GetUser

func (c *Client) GetUser(userID int) (*gitlab.User, error)

GetUser retrieves a user by ID.

func (*Client) GetUserByUsername

func (c *Client) GetUserByUsername(username string) (*gitlab.User, error)

GetUserByUsername retrieves a user by username.

func (*Client) GetUserStatus

func (c *Client) GetUserStatus(userID int) (*UserStatus, error)

GetUserStatus retrieves the GitLab user status. Note: User status API might not be available in all GitLab versions.

func (*Client) ListOpenMergeRequests

func (c *Client) ListOpenMergeRequests(projectID int) ([]*gitlab.BasicMergeRequest, error)

ListOpenMergeRequests lists all open merge requests in a project.

func (*Client) PostComment

func (c *Client) PostComment(projectID, mrIID int, comment string) (int, error)

PostComment posts a comment on a merge request and returns the note ID.

func (*Client) UpdateComment

func (c *Client) UpdateComment(projectID, mrIID, noteID int, comment string) error

UpdateComment updates an existing comment on a merge request.

type UserStatus

type UserStatus struct {
	Availability string // "busy" or empty
	Message      string // status message
}

UserStatus represents a simplified user status.

Jump to

Keyboard shortcuts

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