Documentation
¶
Index ¶
- func LoadIndex() (*models.GitLabIndex, error)
- func SaveIndex(idx *models.GitLabIndex) error
- type Client
- func (c *Client) AddMergeRequestDiscussionReply(projectID any, mrIID int, discussionID, body string) error
- func (c *Client) ApproveMergeRequest(projectID any, mrIID int) error
- func (c *Client) CloseMergeRequest(projectID any, mrIID int) error
- func (c *Client) CreateMergeRequest(projectID any, opts CreateMergeRequestOptions) (*models.MergeRequestDetail, error)
- func (c *Client) CreateMergeRequestInlineComment(projectID any, mrIID int, opts InlineCommentOptions) error
- func (c *Client) CreateMergeRequestNote(projectID any, mrIID int, body string) error
- func (c *Client) CreateMergeRequestNoteReaction(projectID any, mrIID int, noteID int, emoji string) error
- func (c *Client) CreateMergeRequestReaction(projectID any, mrIID int, emoji string) error
- func (c *Client) GetActiveProjects(since time.Time) ([]*gitlab.Project, error)
- func (c *Client) GetCommit(projectID interface{}, sha string) (*models.CommitDetail, error)
- func (c *Client) GetCommits(projectID int, since time.Time) ([]models.Commit, error)
- func (c *Client) GetMergeRequest(projectID interface{}, mrIID int) (*models.MergeRequestDetail, error)
- func (c *Client) GetMergeRequestChanges(projectID any, mrIID int, includeDiff bool) ([]models.MRFile, error)
- func (c *Client) GetMergeRequestCommits(projectID any, mrIID int) ([]models.MRCommit, error)
- func (c *Client) GetMergeRequestDiffVersions(projectID any, mrIID int) (*models.MRDiffVersion, error)
- func (c *Client) GetMergeRequestDiscussions(projectID any, mrIID int) ([]models.MRDiscussion, error)
- func (c *Client) GetMergeRequestNotes(projectID any, mrIID int) ([]models.MRNote, error)
- func (c *Client) GetMergeRequests(projectID int, since time.Time) ([]models.MergeRequest, error)
- func (c *Client) GetParsedDiffForFile(projectID any, mrIID int, filePath string) (*ParsedDiff, error)
- func (c *Client) GetProjectMetadata(idOrPath string) (*models.ProjectMetadata, error)
- func (c *Client) GetTags(projectID int, since time.Time) ([]models.Tag, error)
- func (c *Client) IndexAllProjects(gitlabURL string, progressFn ProgressFunc) (*models.GitLabIndex, error)
- func (c *Client) ListMergeRequests(opts ListMergeRequestsOptions) ([]models.MergeRequestDetail, error)
- func (c *Client) ListProjectCommits(opts ListProjectCommitsOptions) ([]models.Commit, error)
- func (c *Client) ListProjects(opts ListProjectsOptions) ([]*gitlab.Project, error)
- func (c *Client) MergeMergeRequest(projectID any, mrIID int, opts MergeMergeRequestOptions) error
- func (c *Client) ReopenMergeRequest(projectID any, mrIID int) error
- func (c *Client) TestAuth() (*gitlab.User, error)
- type CreateMergeRequestOptions
- type DiffLine
- type InlineCommentOptions
- type LineType
- type ListMergeRequestsOptions
- type ListProjectCommitsOptions
- type ListProjectsOptions
- type MergeMergeRequestOptions
- type ParsedDiff
- func (p *ParsedDiff) FindLineByNew(newLine int) (*DiffLine, bool)
- func (p *ParsedDiff) FindLineByOld(oldLine int) (*DiffLine, bool)
- func (p *ParsedDiff) GetLineWithContext(newLine int, contextLines int) (target *DiffLine, before []DiffLine, after []DiffLine)
- func (p *ParsedDiff) SearchLines(pattern string) ([]DiffLine, error)
- type ProgressFunc
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 (*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 ¶
ApproveMergeRequest approves a merge request
func (*Client) CloseMergeRequest ¶
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 ¶
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 ¶
CreateMergeRequestReaction adds an emoji reaction to a merge request
func (*Client) GetActiveProjects ¶
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 (*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 ¶
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 ¶
GetMergeRequestNotes fetches all notes/comments on a merge request
func (*Client) GetMergeRequests ¶
func (*Client) GetParsedDiffForFile ¶ added in v0.9.0
func (c *Client) GetParsedDiffForFile(projectID any, mrIID int, filePath string) (*ParsedDiff, error)
GetParsedDiffForFile fetches and parses the diff for a specific file in an MR
func (*Client) GetProjectMetadata ¶
func (c *Client) GetProjectMetadata(idOrPath string) (*models.ProjectMetadata, 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) ListProjectCommits ¶ added in v0.41.0
func (c *Client) ListProjectCommits(opts ListProjectCommitsOptions) ([]models.Commit, error)
ListProjectCommits lists commits for a specific project with filtering
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) ReopenMergeRequest ¶ added in v0.44.0
ReopenMergeRequest reopens a closed merge request
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 DiffLine ¶ added in v0.9.0
type DiffLine struct {
Type LineType
OldLine int // 0 if line doesn't exist in old version (added lines)
NewLine int // 0 if line doesn't exist in new version (deleted lines)
Content string // Line content without the prefix
}
DiffLine represents a line in a parsed diff
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 ListProjectCommitsOptions ¶ added in v0.41.0
type ListProjectCommitsOptions struct {
ProjectID string // project path or numeric ID (required)
Branch string // ref filter (branch/tag)
Since time.Time // commits after this time
Limit int // max results (default 20)
}
ListProjectCommitsOptions configures the project commit 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 ParsedDiff ¶ added in v0.9.0
ParsedDiff contains parsed diff information for a file
func ParseUnifiedDiff ¶ added in v0.9.0
func ParseUnifiedDiff(diff string) *ParsedDiff
ParseUnifiedDiff parses a unified diff string into structured data
func (*ParsedDiff) FindLineByNew ¶ added in v0.9.0
func (p *ParsedDiff) FindLineByNew(newLine int) (*DiffLine, bool)
FindLineByNew finds a line by its new line number Returns the DiffLine and whether it was found
func (*ParsedDiff) FindLineByOld ¶ added in v0.9.0
func (p *ParsedDiff) FindLineByOld(oldLine int) (*DiffLine, bool)
FindLineByOld finds a line by its old line number Returns the DiffLine and whether it was found
func (*ParsedDiff) GetLineWithContext ¶ added in v0.13.0
func (p *ParsedDiff) GetLineWithContext(newLine int, contextLines int) (target *DiffLine, before []DiffLine, after []DiffLine)
GetLineWithContext returns a line and its surrounding context lines contextLines specifies how many lines before and after to include
func (*ParsedDiff) SearchLines ¶ added in v0.13.0
func (p *ParsedDiff) SearchLines(pattern string) ([]DiffLine, error)
SearchLines searches for lines matching a regex pattern Returns matching lines with their indices
type ProgressFunc ¶
type ProgressFunc func(completed, total int)