Documentation
¶
Overview ¶
markdown.go provides Markdown formatting functions for project mirror MCP tool output.
Package projectmirrors implements GitLab project remote mirror (push mirror) operations including list, get, get public key, add, edit, delete, and force push update.
register.go wires projectmirrors MCP tools to the MCP server.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, in DeleteInput) error
- func ForcePushUpdate(ctx context.Context, client *gitlabclient.Client, in ForcePushInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatOutputMarkdown(m Output) string
- func FormatPublicKeyMarkdown(pk PublicKeyOutput) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type AddInput
- type DeleteInput
- type EditInput
- type ForcePushInput
- type GetInput
- type GetPublicKeyInput
- type HostKeyOutput
- type ListInput
- type ListOutput
- type Output
- type PublicKeyOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, in DeleteInput) error
Delete removes a remote mirror from a project.
func ForcePushUpdate ¶
func ForcePushUpdate(ctx context.Context, client *gitlabclient.Client, in ForcePushInput) error
ForcePushUpdate triggers an immediate push mirror update.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a paginated list of project mirrors as Markdown.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single project mirror as Markdown.
func FormatPublicKeyMarkdown ¶
func FormatPublicKeyMarkdown(pk PublicKeyOutput) string
FormatPublicKeyMarkdown renders a mirror's SSH public key as Markdown.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers MCP tools for GitLab project mirror operations.
Types ¶
type AddInput ¶
type AddInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
URL string `` /* 127-byte string literal not displayed */
Enabled *bool `json:"enabled,omitempty" jsonschema:"Whether the mirror is enabled"`
KeepDivergentRefs *bool `json:"keep_divergent_refs,omitempty" jsonschema:"Keep divergent refs on the remote"`
OnlyProtectedBranches *bool `json:"only_protected_branches,omitempty" jsonschema:"Mirror only protected branches"`
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty" jsonschema:"Regex pattern for branches to mirror"`
AuthMethod string `json:"auth_method,omitempty" jsonschema:"Authentication method (password or ssh_public_key)"`
HostKeys []string `json:"host_keys,omitempty" jsonschema:"SSH host keys for the remote mirror"`
}
AddInput holds parameters for creating a new project mirror.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
MirrorID int64 `json:"mirror_id" jsonschema:"Remote mirror ID,required"`
}
DeleteInput holds parameters for deleting a project mirror.
type EditInput ¶
type EditInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
MirrorID int64 `json:"mirror_id" jsonschema:"Remote mirror ID,required"`
Enabled *bool `json:"enabled,omitempty" jsonschema:"Whether the mirror is enabled"`
KeepDivergentRefs *bool `json:"keep_divergent_refs,omitempty" jsonschema:"Keep divergent refs on the remote"`
OnlyProtectedBranches *bool `json:"only_protected_branches,omitempty" jsonschema:"Mirror only protected branches"`
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty" jsonschema:"Regex pattern for branches to mirror"`
AuthMethod string `json:"auth_method,omitempty" jsonschema:"Authentication method (password or ssh_public_key)"`
HostKeys []string `json:"host_keys,omitempty" jsonschema:"SSH host keys for the remote mirror"`
}
EditInput holds parameters for updating an existing project mirror.
type ForcePushInput ¶
type ForcePushInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
MirrorID int64 `json:"mirror_id" jsonschema:"Remote mirror ID,required"`
}
ForcePushInput holds parameters for triggering a forced push mirror update.
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
MirrorID int64 `json:"mirror_id" jsonschema:"Remote mirror ID,required"`
}
GetInput holds parameters for retrieving a single project mirror.
type GetPublicKeyInput ¶
type GetPublicKeyInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
MirrorID int64 `json:"mirror_id" jsonschema:"Remote mirror ID,required"`
}
GetPublicKeyInput holds parameters for retrieving a mirror's SSH public key.
type HostKeyOutput ¶
type HostKeyOutput struct {
FingerprintSHA256 string `json:"fingerprint_sha256"`
}
HostKeyOutput represents a host key fingerprint for an SSH-based mirror.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
toolutil.PaginationInput
}
ListInput holds parameters for listing project mirrors.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Mirrors []Output `json:"mirrors"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput contains a paginated list of project mirrors.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, in ListInput) (ListOutput, error)
List returns all remote mirrors for a project.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Enabled bool `json:"enabled"`
URL string `json:"url"`
UpdateStatus string `json:"update_status"`
LastError string `json:"last_error,omitempty"`
LastSuccessfulUpdateAt string `json:"last_successful_update_at,omitempty"`
LastUpdateAt string `json:"last_update_at,omitempty"`
LastUpdateStartedAt string `json:"last_update_started_at,omitempty"`
OnlyProtectedBranches bool `json:"only_protected_branches"`
KeepDivergentRefs bool `json:"keep_divergent_refs"`
MirrorBranchRegex string `json:"mirror_branch_regex,omitempty"`
AuthMethod string `json:"auth_method,omitempty"`
HostKeys []HostKeyOutput `json:"host_keys,omitempty"`
}
Output represents a project mirror.
type PublicKeyOutput ¶
type PublicKeyOutput struct {
toolutil.HintableOutput
PublicKey string `json:"public_key"`
}
PublicKeyOutput represents a mirror's SSH public key.
func GetPublicKey ¶
func GetPublicKey(ctx context.Context, client *gitlabclient.Client, in GetPublicKeyInput) (PublicKeyOutput, error)
GetPublicKey returns the SSH public key for a remote mirror.