Documentation
¶
Overview ¶
Package geo implements MCP tools for GitLab Geo site management, providing CRUD operations and status retrieval for Geo replication sites.
Package geo markdown.go provides human-readable Markdown formatters for Geo site tools.
Package geo register.go wires Geo site MCP tools to the MCP server.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, in IDInput) error
- func FormatListMarkdown(o ListOutput) string
- func FormatListStatusMarkdown(o ListStatusOutput) string
- func FormatOutputMarkdown(o Output) string
- func FormatStatusMarkdown(o StatusOutput) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type CreateInput
- type EditInput
- type IDInput
- type ListInput
- type ListOutput
- type ListStatusInput
- type ListStatusOutput
- type Output
- func Create(ctx context.Context, client *gitlabclient.Client, in CreateInput) (Output, error)
- func Edit(ctx context.Context, client *gitlabclient.Client, in EditInput) (Output, error)
- func Get(ctx context.Context, client *gitlabclient.Client, in IDInput) (Output, error)
- func Repair(ctx context.Context, client *gitlabclient.Client, in IDInput) (Output, error)
- type StatusOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatListMarkdown ¶
func FormatListMarkdown(o ListOutput) string
FormatListMarkdown formats a list of Geo sites as a Markdown table.
func FormatListStatusMarkdown ¶
func FormatListStatusMarkdown(o ListStatusOutput) string
FormatListStatusMarkdown formats a list of Geo site statuses as a Markdown table.
func FormatOutputMarkdown ¶
FormatOutputMarkdown formats a single Geo site as a Markdown table.
func FormatStatusMarkdown ¶
func FormatStatusMarkdown(o StatusOutput) string
FormatStatusMarkdown formats a single Geo site status as a Markdown table.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers MCP tools for GitLab Geo site operations.
Types ¶
type CreateInput ¶
type CreateInput struct {
Primary *bool `json:"primary,omitempty" jsonschema:"Whether this is a primary site"`
Enabled *bool `json:"enabled,omitempty" jsonschema:"Whether the site is enabled"`
Name *string `json:"name,omitempty" jsonschema:"Unique name of the Geo site"`
URL *string `json:"url,omitempty" jsonschema:"External URL of the Geo site"`
InternalURL *string `json:"internal_url,omitempty" jsonschema:"Internal URL of the Geo site"`
FilesMaxCapacity *int64 `json:"files_max_capacity,omitempty" jsonschema:"Max number of LFS/attachment backfill downloads"`
ReposMaxCapacity *int64 `json:"repos_max_capacity,omitempty" jsonschema:"Max number of concurrent repository backfill syncs"`
VerificationMaxCapacity *int64 `json:"verification_max_capacity,omitempty" jsonschema:"Max number of concurrent verification jobs"`
ContainerRepositoriesMaxCapacity *int64 `json:"container_repositories_max_capacity,omitempty" jsonschema:"Max number of concurrent container repository syncs"`
SyncObjectStorage *bool `json:"sync_object_storage,omitempty" jsonschema:"Whether to sync object-stored data"`
SelectiveSyncType *string `json:"selective_sync_type,omitempty" jsonschema:"Selective sync type: namespaces or shards"`
SelectiveSyncShards *[]string `json:"selective_sync_shards,omitempty" jsonschema:"Storage shards to sync (when selective_sync_type=shards)"`
SelectiveSyncNamespaceIDs *[]int64 `json:"selective_sync_namespace_ids,omitempty" jsonschema:"Namespace IDs to sync (when selective_sync_type=namespaces)"`
MinimumReverificationInterval *int64 `json:"minimum_reverification_interval,omitempty" jsonschema:"Minimum interval (days) before re-verification"`
}
CreateInput holds parameters for creating a new Geo site.
type EditInput ¶
type EditInput struct {
ID int64 `json:"id" jsonschema:"Numeric ID of the Geo site,required"`
Enabled *bool `json:"enabled,omitempty" jsonschema:"Whether the site is enabled"`
Name *string `json:"name,omitempty" jsonschema:"Unique name of the Geo site"`
URL *string `json:"url,omitempty" jsonschema:"External URL of the Geo site"`
InternalURL *string `json:"internal_url,omitempty" jsonschema:"Internal URL of the Geo site"`
FilesMaxCapacity *int64 `json:"files_max_capacity,omitempty" jsonschema:"Max number of LFS/attachment backfill downloads"`
ReposMaxCapacity *int64 `json:"repos_max_capacity,omitempty" jsonschema:"Max number of concurrent repository backfill syncs"`
VerificationMaxCapacity *int64 `json:"verification_max_capacity,omitempty" jsonschema:"Max number of concurrent verification jobs"`
ContainerRepositoriesMaxCapacity *int64 `json:"container_repositories_max_capacity,omitempty" jsonschema:"Max number of concurrent container repository syncs"`
SelectiveSyncType *string `json:"selective_sync_type,omitempty" jsonschema:"Selective sync type: namespaces or shards"`
SelectiveSyncShards *[]string `json:"selective_sync_shards,omitempty" jsonschema:"Storage shards to sync"`
SelectiveSyncNamespaceIDs *[]int64 `json:"selective_sync_namespace_ids,omitempty" jsonschema:"Namespace IDs to sync"`
MinimumReverificationInterval *int64 `json:"minimum_reverification_interval,omitempty" jsonschema:"Minimum interval (days) before re-verification"`
}
EditInput holds parameters for editing an existing Geo site.
type IDInput ¶
type IDInput struct {
ID int64 `json:"id" jsonschema:"Numeric ID of the Geo site,required"`
}
IDInput holds a Geo site ID for get/delete/repair operations.
type ListInput ¶
type ListInput struct {
toolutil.PaginationInput
}
ListInput holds pagination parameters for listing Geo sites.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Sites []Output `json:"sites"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput represents a paginated list of Geo sites.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, in ListInput) (ListOutput, error)
List retrieves all Geo sites.
type ListStatusInput ¶
type ListStatusInput struct {
toolutil.PaginationInput
}
ListStatusInput holds pagination parameters for listing all Geo site statuses.
type ListStatusOutput ¶
type ListStatusOutput struct {
toolutil.HintableOutput
Statuses []StatusOutput `json:"statuses"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListStatusOutput represents a paginated list of Geo site statuses.
func ListStatus ¶
func ListStatus(ctx context.Context, client *gitlabclient.Client, in ListStatusInput) (ListStatusOutput, error)
ListStatus retrieves the replication status of all Geo sites.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
InternalURL string `json:"internal_url,omitempty"`
Primary bool `json:"primary"`
Enabled bool `json:"enabled"`
Current bool `json:"current"`
FilesMaxCapacity int64 `json:"files_max_capacity"`
ReposMaxCapacity int64 `json:"repos_max_capacity"`
VerificationMaxCapacity int64 `json:"verification_max_capacity"`
ContainerRepositoriesMaxCapacity int64 `json:"container_repositories_max_capacity"`
SelectiveSyncType string `json:"selective_sync_type,omitempty"`
SelectiveSyncShards []string `json:"selective_sync_shards,omitempty"`
SelectiveSyncNamespaceIDs []int64 `json:"selective_sync_namespace_ids,omitempty"`
MinimumReverificationInterval int64 `json:"minimum_reverification_interval"`
SyncObjectStorage bool `json:"sync_object_storage"`
WebEditURL string `json:"web_edit_url,omitempty"`
}
Output represents a single Geo site.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, in CreateInput) (Output, error)
Create creates a new Geo site.
type StatusOutput ¶
type StatusOutput struct {
toolutil.HintableOutput
GeoNodeID int64 `json:"geo_node_id"`
Healthy bool `json:"healthy"`
Health string `json:"health"`
HealthStatus string `json:"health_status"`
MissingOAuthApplication bool `json:"missing_oauth_application"`
DBReplicationLagSeconds int64 `json:"db_replication_lag_seconds"`
ProjectsCount int64 `json:"projects_count"`
LFSObjectsSyncedInPercentage string `json:"lfs_objects_synced_in_percentage"`
JobArtifactsSyncedInPercentage string `json:"job_artifacts_synced_in_percentage"`
UploadsSyncedInPercentage string `json:"uploads_synced_in_percentage"`
Version string `json:"version"`
Revision string `json:"revision"`
StorageShardsMatch bool `json:"storage_shards_match"`
UpdatedAt time.Time `json:"updated_at"`
}
StatusOutput represents the status of a Geo site (summary fields).
func GetStatus ¶
func GetStatus(ctx context.Context, client *gitlabclient.Client, in IDInput) (StatusOutput, error)
GetStatus retrieves the replication status of a specific Geo site.