Documentation
¶
Overview ¶
Package instancevariables implements MCP tools for GitLab instance CI/CD variable operations.
The package wraps the GitLab Instance-level CI/CD variables API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatOutputMarkdown(v Output) string
- type CreateInput
- type DeleteInput
- type GetInput
- type ListInput
- type ListOutput
- type Output
- type UpdateInput
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 instance CI/CD variable actions.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes an instance-level CI/CD variable by key.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a paginated list of instance CI/CD variables as a Markdown table.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single instance CI/CD variable as Markdown.
Hidden is the second half of the guard and was missing: GitLab lets an instance variable be created with the value hidden from every later reader, and it sends that value back to an administrator's own request, so a card that asked only whether the variable was masked printed it. The shared renderer this delegates to has held both halves since hidden variables existed, and it reports the flag as well, which the card did not. The card names the environment scope, which the view model used to drop: an instance variable carries one like every other CI/CD variable, and the project and group cards have always shown it. The list table leaves it out, where a column repeating the same scope on every row says nothing.
Types ¶
type CreateInput ¶
type CreateInput struct {
Key string `json:"key" jsonschema:"Variable key name,required"`
Value string `json:"value" jsonschema:"Variable value,required"`
Description string `json:"description,omitempty" jsonschema:"Variable description"`
VariableType string `json:"variable_type,omitempty" jsonschema:"Variable type: env_var or file"`
Protected *bool `json:"protected,omitempty" jsonschema:"Only expose in protected branches/tags"`
Masked *bool `json:"masked,omitempty" jsonschema:"Mask variable value in job logs"`
Raw *bool `json:"raw,omitempty" jsonschema:"Treat variable value as raw string"`
}
CreateInput holds parameters for creating an instance CI/CD variable.
type DeleteInput ¶
type DeleteInput struct {
Key string `json:"key" jsonschema:"Variable key name,required"`
}
DeleteInput holds parameters for deleting an instance CI/CD variable.
type GetInput ¶
type GetInput struct {
Key string `json:"key" jsonschema:"Variable key name,required"`
}
GetInput holds parameters for retrieving a single instance CI/CD variable.
type ListInput ¶
type ListInput struct {
OrderBy string `json:"order_by,omitempty" jsonschema:"Column by which to order keyset-paginated results"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction for keyset-paginated results (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInput holds parameters for listing instance CI/CD variables. The OrderBy, Sort, and embedded KeysetPaginationInput fields mirror the SDK gl.ListInstanceVariablesOptions (its embedded gl.ListOptions: order_by, sort, pagination, page_token) so every supported list filter is exposed 1:1.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Variables []Output `json:"variables"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput represents a paginated list of instance CI/CD variables.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of instance-level CI/CD variables.
type Output ¶
type Output struct {
toolutil.HintableOutput
Key string `json:"key"`
Value string `json:"value"`
VariableType string `json:"variable_type"`
Protected bool `json:"protected"`
Masked bool `json:"masked"`
Raw bool `json:"raw"`
Description string `json:"description"`
// EnvironmentScope is the environments the value applies to, and Hidden
// whether the value is withheld from every reader once set.
EnvironmentScope string `json:"environment_scope,omitempty"`
Hidden bool `json:"hidden"`
}
Output represents a single instance CI/CD variable.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new instance-level CI/CD variable.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update modifies an existing instance-level CI/CD variable.
type UpdateInput ¶
type UpdateInput struct {
Key string `json:"key" jsonschema:"Variable key name,required"`
Value *string `` /* 141-byte string literal not displayed */
Description *string `` /* 148-byte string literal not displayed */
VariableType string `json:"variable_type,omitempty" jsonschema:"Variable type: env_var or file"`
Protected *bool `json:"protected,omitempty" jsonschema:"Only expose in protected branches/tags"`
Masked *bool `json:"masked,omitempty" jsonschema:"Mask variable value in job logs"`
Raw *bool `json:"raw,omitempty" jsonschema:"Treat variable value as raw string"`
}
UpdateInput holds parameters for updating an instance CI/CD variable.