gitlab

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

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 は GitLab API クライアントのラッパー

func NewClient

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

NewClient は新しい GitLab クライアントを作成する

func (*Client) AddMergeRequestComment

func (c *Client) AddMergeRequestComment(projectID string, mrIID int, body string) (*gogitlab.Note, error)

AddMergeRequestComment はMRに一般コメントを追加する

func (*Client) AddMergeRequestDiscussionNote added in v0.3.0

func (c *Client) AddMergeRequestDiscussionNote(projectID string, mrIID int, discussionID string, body string) (*gogitlab.Note, error)

AddMergeRequestDiscussionNote はディスカッションに返信ノートを追加する

func (*Client) ApproveMergeRequest

func (c *Client) ApproveMergeRequest(projectID string, mrIID int) (*gogitlab.MergeRequestApprovals, error)

ApproveMergeRequest はMRを承認する

func (*Client) CreateMergeRequest

func (c *Client) CreateMergeRequest(projectID string, opts *CreateMergeRequestOptions) (*gogitlab.MergeRequest, error)

CreateMergeRequest は新しいMRを作成する

func (*Client) CreateMergeRequestDiscussion

func (c *Client) CreateMergeRequestDiscussion(projectID string, mrIID int, opts *CreateDiscussionOptions) (*gogitlab.Discussion, error)

CreateMergeRequestDiscussion は行コメント(ディスカッション)を作成する

func (*Client) DeleteMergeRequestNote added in v0.2.2

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

DeleteMergeRequestNote はMRのコメント(ノート)を削除する

func (*Client) Discussions

func (c *Client) Discussions() gogitlab.DiscussionsServiceInterface

Discussions returns the DiscussionsService

func (*Client) GetMergeRequest

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

GetMergeRequest はMRの詳細を取得する

func (*Client) GetMergeRequestApprovals

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

GetMergeRequestApprovals はMRの承認状態を取得する

func (*Client) GetMergeRequestChanges

func (c *Client) GetMergeRequestChanges(projectID string, mrIID int, pagination *PaginationOptions) ([]*gogitlab.MergeRequestDiff, error)

GetMergeRequestChanges はMRの変更差分を取得する

func (*Client) Jobs

Jobs returns the JobsService

func (*Client) ListMergeRequestDiscussions

func (c *Client) ListMergeRequestDiscussions(projectID string, mrIID int, pagination *PaginationOptions) ([]*gogitlab.Discussion, error)

ListMergeRequestDiscussions はMRのディスカッション一覧を取得する

func (*Client) ListMergeRequestPipelines

func (c *Client) ListMergeRequestPipelines(projectID string, mrIID int) ([]*gogitlab.PipelineInfo, error)

ListMergeRequestPipelines はMRに関連するパイプライン一覧を取得する

func (*Client) ListMergeRequests

func (c *Client) ListMergeRequests(projectID string, opts *ListMergeRequestsOptions) ([]*gogitlab.BasicMergeRequest, error)

ListMergeRequests はプロジェクトのMR一覧を取得する

func (*Client) ListPipelineJobs

func (c *Client) ListPipelineJobs(projectID string, pipelineID int, pagination *PaginationOptions) ([]*gogitlab.Job, error)

ListPipelineJobs はパイプラインのジョブ一覧を取得する

func (*Client) MergeMergeRequest

func (c *Client) MergeMergeRequest(projectID string, mrIID int, opts *MergeMergeRequestOptions) (*gogitlab.MergeRequest, error)

MergeMergeRequest はMRをマージする

func (*Client) MergeRequestApprovals

func (c *Client) MergeRequestApprovals() gogitlab.MergeRequestApprovalsServiceInterface

MergeRequestApprovals returns the MergeRequestApprovalsService

func (*Client) MergeRequests

func (c *Client) MergeRequests() gogitlab.MergeRequestsServiceInterface

MergeRequests returns the MergeRequestsService

func (*Client) Notes

Notes returns the NotesService

func (*Client) Pipelines

func (c *Client) Pipelines() gogitlab.PipelinesServiceInterface

Pipelines returns the PipelinesService

func (*Client) ResolveMergeRequestDiscussion

func (c *Client) ResolveMergeRequestDiscussion(projectID string, mrIID int, discussionID string, resolved bool) (*gogitlab.Discussion, error)

ResolveMergeRequestDiscussion はディスカッションの解決状態を変更する

func (*Client) UnapproveMergeRequest

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

UnapproveMergeRequest はMRの承認を取り消す

func (*Client) UpdateMergeRequest

func (c *Client) UpdateMergeRequest(projectID string, mrIID int, opts *UpdateMergeRequestOptions) (*gogitlab.MergeRequest, error)

UpdateMergeRequest は既存のMRを更新する

type CreateDiscussionOptions

type CreateDiscussionOptions struct {
	Body     string
	FilePath string
	OldLine  *int
	NewLine  *int
	BaseSHA  string
	HeadSHA  string
	StartSHA string
}

CreateDiscussionOptions はディスカッション作成のオプション

type CreateMergeRequestOptions

type CreateMergeRequestOptions struct {
	SourceBranch string
	TargetBranch string
	Title        string
	Description  *string
	AssigneeIDs  []int
	ReviewerIDs  []int
	Labels       []string
}

CreateMergeRequestOptions はMR作成のオプション

type ErrorCode

type ErrorCode string

ErrorCode はエラーコード

const (
	ErrCodeUnauthorized ErrorCode = "unauthorized"
	ErrCodeForbidden    ErrorCode = "forbidden"
	ErrCodeNotFound     ErrorCode = "not_found"
	ErrCodeRateLimited  ErrorCode = "rate_limited"
	ErrCodeBadRequest   ErrorCode = "bad_request"
	ErrCodeServerError  ErrorCode = "server_error"
	ErrCodeToolDisabled ErrorCode = "tool_disabled"
)

type ListMergeRequestsOptions

type ListMergeRequestsOptions struct {
	State      *string
	AuthorID   *int
	AssigneeID *int
	Page       int
	PerPage    int
}

ListMergeRequestsOptions はMR一覧取得のオプション

type MCPError

type MCPError struct {
	Code    ErrorCode
	Message string
}

MCPError は MCP 互換エラー

func FromGitLabResponse

func FromGitLabResponse(err error, resp *gogitlab.Response) *MCPError

FromGitLabResponse は GitLab SDK レスポンスから MCPError を作成する

func NewToolDisabledError

func NewToolDisabledError(toolName string) *MCPError

NewToolDisabledError はツール無効化エラーを作成する

func (*MCPError) Error

func (e *MCPError) Error() string

Error implements the error interface

func (*MCPError) IsRetryable

func (e *MCPError) IsRetryable() bool

IsRetryable はリトライ可能なエラーかどうかを返す

type MergeMergeRequestOptions

type MergeMergeRequestOptions struct {
	Squash                   *bool
	ShouldRemoveSourceBranch *bool
	MergeCommitMessage       *string
	SquashCommitMessage      *string
}

MergeMergeRequestOptions はMRマージのオプション

type PaginationOptions added in v0.2.1

type PaginationOptions struct {
	Page    int
	PerPage int
}

PaginationOptions はページネーションのオプション

type UpdateMergeRequestOptions

type UpdateMergeRequestOptions struct {
	Title        *string
	Description  *string
	AssigneeIDs  []int
	ReviewerIDs  []int
	Labels       []string
	TargetBranch *string
}

UpdateMergeRequestOptions はMR更新のオプション

Jump to

Keyboard shortcuts

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