gitlab

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadIndex

func LoadIndex() (*models.GitLabIndex, error)

func SaveIndex

func SaveIndex(idx *models.GitLabIndex) error

Types

type Client

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

func NewClient

func NewClient(url, token string) (*Client, error)

func (*Client) AddMergeRequestDiscussionReply

func (c *Client) AddMergeRequestDiscussionReply(projectID any, mrIID int, discussionID, body string) error

AddMergeRequestDiscussionReply adds a reply to an existing discussion thread

func (*Client) ApproveMergeRequest

func (c *Client) ApproveMergeRequest(projectID any, mrIID int) error

ApproveMergeRequest approves a merge request

func (*Client) CloseMergeRequest

func (c *Client) CloseMergeRequest(projectID any, mrIID int) error

CloseMergeRequest closes a merge request

func (*Client) CreateMergeRequest

func (c *Client) CreateMergeRequest(projectID any, opts CreateMergeRequestOptions) (*models.MergeRequestDetail, error)

CreateMergeRequest creates a new merge request and returns its details

func (*Client) CreateMergeRequestInlineComment

func (c *Client) CreateMergeRequestInlineComment(projectID any, mrIID int, opts InlineCommentOptions) error

CreateMergeRequestInlineComment creates an inline comment on a specific file/line

func (*Client) CreateMergeRequestNote

func (c *Client) CreateMergeRequestNote(projectID any, mrIID int, body string) error

CreateMergeRequestNote adds a comment/note to a merge request

func (*Client) CreateMergeRequestNoteReaction

func (c *Client) CreateMergeRequestNoteReaction(projectID any, mrIID int, noteID int, emoji string) error

CreateMergeRequestNoteReaction adds an emoji reaction to a note/comment on a merge request

func (*Client) CreateMergeRequestReaction

func (c *Client) CreateMergeRequestReaction(projectID any, mrIID int, emoji string) error

CreateMergeRequestReaction adds an emoji reaction to a merge request

func (*Client) GetActiveProjects

func (c *Client) GetActiveProjects(since time.Time) ([]*gitlab.Project, error)

func (*Client) GetCommit

func (c *Client) GetCommit(projectID interface{}, sha string) (*models.CommitDetail, error)

GetCommit fetches detailed information about a single commit

func (*Client) GetCommits

func (c *Client) GetCommits(projectID int, since time.Time) ([]models.Commit, error)

func (*Client) GetMergeRequest

func (c *Client) GetMergeRequest(projectID interface{}, mrIID int) (*models.MergeRequestDetail, error)

GetMergeRequest fetches a single merge request with full details

func (*Client) GetMergeRequestChanges

func (c *Client) GetMergeRequestChanges(projectID any, mrIID int, includeDiff bool) ([]models.MRFile, error)

GetMergeRequestChanges fetches the list of files changed in a merge request

func (*Client) GetMergeRequestCommits

func (c *Client) GetMergeRequestCommits(projectID any, mrIID int) ([]models.MRCommit, error)

GetMergeRequestCommits fetches commits associated with a merge request

func (*Client) GetMergeRequestDiffVersions

func (c *Client) GetMergeRequestDiffVersions(projectID any, mrIID int) (*models.MRDiffVersion, error)

GetMergeRequestDiffVersions fetches the diff version info needed for inline comments

func (*Client) GetMergeRequestDiscussions

func (c *Client) GetMergeRequestDiscussions(projectID any, mrIID int) ([]models.MRDiscussion, error)

GetMergeRequestDiscussions fetches all discussions/threads on a merge request

func (*Client) GetMergeRequestNotes

func (c *Client) GetMergeRequestNotes(projectID any, mrIID int) ([]models.MRNote, error)

GetMergeRequestNotes fetches all notes/comments on a merge request

func (*Client) GetMergeRequests

func (c *Client) GetMergeRequests(projectID int, since time.Time) ([]models.MergeRequest, error)

func (*Client) GetProjectMetadata

func (c *Client) GetProjectMetadata(idOrPath string) (*models.ProjectMetadata, error)

func (*Client) GetTags

func (c *Client) GetTags(projectID int, since time.Time) ([]models.Tag, error)

func (*Client) IndexAllProjects

func (c *Client) IndexAllProjects(gitlabURL string, progressFn ProgressFunc) (*models.GitLabIndex, error)

func (*Client) ListMergeRequests

func (c *Client) ListMergeRequests(opts ListMergeRequestsOptions) ([]models.MergeRequestDetail, error)

ListMergeRequests fetches merge requests based on options

func (*Client) ListProjects

func (c *Client) ListProjects(opts ListProjectsOptions) ([]*gitlab.Project, error)

ListProjects returns projects with configurable sorting and limit

func (*Client) MergeMergeRequest

func (c *Client) MergeMergeRequest(projectID any, mrIID int, opts MergeMergeRequestOptions) error

MergeMergeRequest merges (accepts) a merge request

func (*Client) TestAuth added in v0.3.0

func (c *Client) TestAuth() (*gitlab.User, error)

TestAuth verifies the token works and returns current user info

type CreateMergeRequestOptions

type CreateMergeRequestOptions struct {
	Title              string
	Description        string
	SourceBranch       string
	TargetBranch       string
	Draft              bool
	RemoveSourceBranch bool
	Squash             bool
}

CreateMergeRequestOptions contains options for creating a merge request

type InlineCommentOptions

type InlineCommentOptions struct {
	Body    string
	NewPath string
	OldPath string
	NewLine int
	OldLine int
}

InlineCommentOptions contains options for creating an inline/diff comment

type ListMergeRequestsOptions

type ListMergeRequestsOptions struct {
	State         string // opened, closed, merged, all
	Scope         string // created_by_me, assigned_to_me, all
	Limit         int
	OrderBy       string // created_at, updated_at
	Sort          string // asc, desc
	ProjectID     string // optional - filter to specific project
	IncludeWIP    bool   // include WIP/draft MRs (excluded by default)
	ConflictsOnly bool   // only show MRs with conflicts
}

ListMergeRequestsOptions configures the MR list query

type ListProjectsOptions

type ListProjectsOptions struct {
	Limit   int    // Maximum number of projects to return (0 = all)
	OrderBy string // Sort field: "created_at", "last_activity_at", "name", "path", "id"
	Sort    string // Sort direction: "asc" or "desc"
}

ListProjectsOptions configures the ListProjects call

type MergeMergeRequestOptions

type MergeMergeRequestOptions struct {
	Squash                    bool
	RemoveSourceBranch        bool
	MergeWhenPipelineSucceeds bool
	MergeCommitMessage        string
	SquashCommitMessage       string
}

MergeMergeRequestOptions contains options for merging a merge request

type ProgressFunc

type ProgressFunc func(completed, total int)

Jump to

Keyboard shortcuts

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