Documentation
¶
Overview ¶
Package projectimportexport implements MCP tools for GitLab project import and export operations.
The package wraps the GitLab Project import/export API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatExportDownloadMarkdown(out ExportDownloadOutput) *mcp.CallToolResult
- func FormatExportStatusMarkdown(out ExportStatusOutput) *mcp.CallToolResult
- func FormatImportStatusMarkdown(out ImportStatusOutput) *mcp.CallToolResult
- func FormatScheduleExportMarkdown(out ScheduleExportOutput) *mcp.CallToolResult
- type ExportDownloadInput
- type ExportDownloadOutput
- type ExportStatusInput
- type ExportStatusOutput
- type GetImportStatusInput
- type ImportFromFileInput
- type ImportStatusOutput
- type ScheduleExportInput
- type ScheduleExportOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
ActionSpecs returns canonical specs for project import and export actions.
func FormatExportDownloadMarkdown ¶
func FormatExportDownloadMarkdown(out ExportDownloadOutput) *mcp.CallToolResult
FormatExportDownloadMarkdown coordinates format export download markdown for the projectimportexport package.
func FormatExportStatusMarkdown ¶
func FormatExportStatusMarkdown(out ExportStatusOutput) *mcp.CallToolResult
FormatExportStatusMarkdown coordinates format export status markdown for the projectimportexport package.
func FormatImportStatusMarkdown ¶
func FormatImportStatusMarkdown(out ImportStatusOutput) *mcp.CallToolResult
FormatImportStatusMarkdown coordinates format import status markdown for the projectimportexport package.
func FormatScheduleExportMarkdown ¶
func FormatScheduleExportMarkdown(out ScheduleExportOutput) *mcp.CallToolResult
FormatScheduleExportMarkdown coordinates format schedule export markdown for the projectimportexport package.
Types ¶
type ExportDownloadInput ¶
type ExportDownloadInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
ExportDownloadInput is the input for downloading a project export.
type ExportDownloadOutput ¶
type ExportDownloadOutput struct {
toolutil.HintableOutput
ContentBase64 string `json:"content_base64"`
SizeBytes int `json:"size_bytes"`
}
ExportDownloadOutput is the output for downloading a project export.
func ExportDownload ¶
func ExportDownload(ctx context.Context, client *gitlabclient.Client, input ExportDownloadInput) (ExportDownloadOutput, error)
ExportDownload downloads the finished export archive of a project as base64.
type ExportStatusInput ¶
type ExportStatusInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
ExportStatusInput is the input for getting export status.
type ExportStatusOutput ¶
type ExportStatusOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Description string `json:"description"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
CreatedAt string `json:"created_at,omitempty"`
ExportStatus string `json:"export_status"`
Message string `json:"message,omitempty"`
APIURL string `json:"api_url,omitempty"`
WebURL string `json:"web_url,omitempty"`
}
ExportStatusOutput is the output for getting export status.
func GetExportStatus ¶
func GetExportStatus(ctx context.Context, client *gitlabclient.Client, input ExportStatusInput) (ExportStatusOutput, error)
GetExportStatus returns the export status of a project.
type GetImportStatusInput ¶
type GetImportStatusInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetImportStatusInput is the input for getting import status.
type ImportFromFileInput ¶
type ImportFromFileInput struct {
FilePath string `` /* 289-byte string literal not displayed */
ContentBase64 string `` /* 143-byte string literal not displayed */
Namespace string `json:"namespace,omitempty" jsonschema:"Namespace to import the project into (user or group path)"`
Name string `json:"name,omitempty" jsonschema:"Name for the imported project"`
Path string `json:"path,omitempty" jsonschema:"URL path for the imported project"`
Overwrite *bool `json:"overwrite,omitempty" jsonschema:"If true, overwrite an existing project with the same path"`
}
ImportFromFileInput is the input for importing a project from an archive file.
type ImportStatusOutput ¶
type ImportStatusOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Description string `json:"description"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
CreatedAt string `json:"created_at,omitempty"`
ImportStatus string `json:"import_status"`
ImportType string `json:"import_type,omitempty"`
CorrelationID string `json:"correlation_id,omitempty"`
ImportError string `json:"import_error,omitempty"`
}
ImportStatusOutput is the output for import operations.
func GetImportStatus ¶
func GetImportStatus(ctx context.Context, client *gitlabclient.Client, input GetImportStatusInput) (ImportStatusOutput, error)
GetImportStatus returns the import status of a project.
func ImportFromFile ¶
func ImportFromFile(ctx context.Context, client *gitlabclient.Client, input ImportFromFileInput) (ImportStatusOutput, error)
ImportFromFile imports a project from an export archive.
type ScheduleExportInput ¶
type ScheduleExportInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
Description string `json:"description,omitempty" jsonschema:"Override the project description in the export"`
UploadURL string `json:"upload_url,omitempty" jsonschema:"URL to upload the exported project to after export completes"`
UploadHTTP string `json:"upload_http_method,omitempty" jsonschema:"HTTP method to use for the upload (PUT or POST)"`
}
ScheduleExportInput is the input for scheduling a project export.
type ScheduleExportOutput ¶
type ScheduleExportOutput struct {
toolutil.HintableOutput
Message string `json:"message"`
}
ScheduleExportOutput is the output for scheduling a project export.
func ScheduleExport ¶
func ScheduleExport(ctx context.Context, client *gitlabclient.Client, input ScheduleExportInput) (ScheduleExportOutput, error)
ScheduleExport schedules an asynchronous project export.