importservice

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package importservice implements MCP tools for GitLab external import operations.

The package wraps the GitLab Import API:

Index

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 external import tools.

func FormatBitbucketCloudImport

func FormatBitbucketCloudImport(out *BitbucketCloudImportOutput) string

FormatBitbucketCloudImport formats a Bitbucket Cloud import result as markdown.

func FormatBitbucketServerImport

func FormatBitbucketServerImport(out *BitbucketServerImportOutput) string

FormatBitbucketServerImport formats a Bitbucket Server import result as markdown.

func FormatCancelledImport

func FormatCancelledImport(out *CancelledImportOutput) string

FormatCancelledImport formats a canceled import result as markdown.

func FormatGitHubImport

func FormatGitHubImport(out *GitHubImportOutput) string

FormatGitHubImport formats a GitHub import result as markdown.

func FormatImportGists

func FormatImportGists() string

FormatImportGists formats the gist import result as markdown.

func ImportGists

func ImportGists(ctx context.Context, client *gitlabclient.Client, input ImportGistsInput) error

ImportGists imports GitHub gists into GitLab snippets.

Types

type BitbucketCloudImportOutput

type BitbucketCloudImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
}

BitbucketCloudImportOutput represents the output of a Bitbucket Cloud import.

func ImportFromBitbucketCloud

func ImportFromBitbucketCloud(ctx context.Context, client *gitlabclient.Client, input ImportFromBitbucketCloudInput) (*BitbucketCloudImportOutput, error)

ImportFromBitbucketCloud imports a repository from Bitbucket Cloud into GitLab.

type BitbucketServerImportOutput

type BitbucketServerImportOutput struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullPath string `json:"full_path"`
	FullName string `json:"full_name"`
}

BitbucketServerImportOutput represents the output of a Bitbucket Server import.

func ImportFromBitbucketServer

func ImportFromBitbucketServer(ctx context.Context, client *gitlabclient.Client, input ImportFromBitbucketServerInput) (*BitbucketServerImportOutput, error)

ImportFromBitbucketServer imports a repository from Bitbucket Server into GitLab.

type CancelGitHubImportInput

type CancelGitHubImportInput struct {
	ProjectID int64 `json:"project_id" jsonschema:"The GitLab project ID of the import to cancel,required"`
}

CancelGitHubImportInput represents input for canceling a GitHub import.

type CancelledImportOutput

type CancelledImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
}

CancelledImportOutput represents the output of a canceled GitHub import.

func CancelGitHubImport

func CancelGitHubImport(ctx context.Context, client *gitlabclient.Client, input CancelGitHubImportInput) (*CancelledImportOutput, error)

CancelGitHubImport cancels an ongoing GitHub import.

type GitHubImportOutput

type GitHubImportOutput struct {
	ID                    int64  `json:"id"`
	Name                  string `json:"name"`
	FullPath              string `json:"full_path"`
	FullName              string `json:"full_name"`
	ImportSource          string `json:"import_source"`
	ImportStatus          string `json:"import_status"`
	HumanImportStatusName string `json:"human_import_status_name,omitempty"`
	ProviderLink          string `json:"provider_link,omitempty"`
	RelationType          string `json:"relation_type,omitempty"`
}

GitHubImportOutput represents the output of a GitHub import operation.

func ImportFromGitHub

func ImportFromGitHub(ctx context.Context, client *gitlabclient.Client, input ImportFromGitHubInput) (*GitHubImportOutput, error)

ImportFromGitHub imports a repository from GitHub into GitLab.

type ImportFromBitbucketCloudInput

type ImportFromBitbucketCloudInput struct {
	BitbucketUsername    string `json:"bitbucket_username" jsonschema:"Bitbucket Cloud username,required"`
	BitbucketAppPassword string `` /* 156-byte string literal not displayed */
	RepoPath             string `json:"repo_path" jsonschema:"Bitbucket repository path (e.g. owner/repo),required"`
	TargetNamespace      string `json:"target_namespace" jsonschema:"Target namespace for the imported project,required"`
	NewName              string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
}

ImportFromBitbucketCloudInput represents input for importing from Bitbucket Cloud.

type ImportFromBitbucketServerInput

type ImportFromBitbucketServerInput struct {
	BitbucketServerURL      string `json:"bitbucket_server_url" jsonschema:"Bitbucket Server URL,required"`
	BitbucketServerUsername string `json:"bitbucket_server_username" jsonschema:"Bitbucket Server username,required"`
	PersonalAccessToken     string `` /* 165-byte string literal not displayed */
	BitbucketServerProject  string `json:"bitbucket_server_project" jsonschema:"Bitbucket Server project key,required"`
	BitbucketServerRepo     string `json:"bitbucket_server_repo" jsonschema:"Bitbucket Server repository slug,required"`
	NewName                 string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
	NewNamespace            string `json:"new_namespace,omitempty" jsonschema:"Target namespace for the imported project"`
	TimeoutStrategy         string `json:"timeout_strategy,omitempty" jsonschema:"Timeout strategy (optimistic or pessimistic)"`
}

ImportFromBitbucketServerInput represents input for importing from Bitbucket Server.

type ImportFromGitHubInput

type ImportFromGitHubInput struct {
	PersonalAccessToken string `` /* 155-byte string literal not displayed */
	RepoID              int64  `json:"repo_id" jsonschema:"GitHub repository ID,required"`
	NewName             string `json:"new_name,omitempty" jsonschema:"New name for the imported project"`
	TargetNamespace     string `json:"target_namespace" jsonschema:"Target namespace for the imported project,required"`
	GitHubHostname      string `json:"github_hostname,omitempty" jsonschema:"GitHub hostname for GitHub Enterprise"`
	TimeoutStrategy     string `json:"timeout_strategy,omitempty" jsonschema:"Timeout strategy (optimistic or pessimistic)"`
}

ImportFromGitHubInput represents input for importing a repository from GitHub.

type ImportGistsInput

type ImportGistsInput struct {
	PersonalAccessToken string `` /* 155-byte string literal not displayed */
}

ImportGistsInput represents input for importing GitHub gists as GitLab snippets.

Jump to

Keyboard shortcuts

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