Documentation
¶
Overview ¶
Package groupvariables implements MCP tools for GitLab group CI/CD variable operations.
The package wraps the GitLab Group-level 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 Filter
- 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 group CI/CD variable actions.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes a group CI/CD variable by key.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a paginated list of group CI/CD variables as a Markdown table.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single group CI/CD variable as Markdown.
Types ¶
type CreateInput ¶
type CreateInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Key string `json:"key" jsonschema:"Variable key name,required"`
Value string `json:"value" jsonschema:"Variable value"`
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"`
MaskedAndHidden *bool `json:"masked_and_hidden,omitempty" jsonschema:"Mask and hide variable value"`
Raw *bool `json:"raw,omitempty" jsonschema:"Treat variable value as raw string"`
EnvironmentScope string `json:"environment_scope,omitempty" jsonschema:"Environment scope (default: *)"`
}
CreateInput holds parameters for creating a group CI/CD variable.
type DeleteInput ¶
type DeleteInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Key string `json:"key" jsonschema:"Variable key name,required"`
EnvironmentScope string `json:"environment_scope,omitempty" jsonschema:"Filter by environment scope (shorthand for filter.environment_scope)"`
Filter *Filter `` /* 144-byte string literal not displayed */
}
DeleteInput holds parameters for deleting a group CI/CD variable.
type Filter ¶ added in v2.3.0
type Filter struct {
EnvironmentScope string `json:"environment_scope,omitempty" jsonschema:"Filter the variable by its environment scope (e.g. * or production)"`
}
Filter mirrors gitlab.VariableFilter: the available filter on group variable get/update/delete operations, selecting the variable instance by its environment scope when several variables share a key.
type GetInput ¶
type GetInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Key string `json:"key" jsonschema:"Variable key name,required"`
EnvironmentScope string `json:"environment_scope,omitempty" jsonschema:"Filter by environment scope (shorthand for filter.environment_scope)"`
Filter *Filter `` /* 130-byte string literal not displayed */
}
GetInput holds parameters for retrieving a single group CI/CD variable.
type ListInput ¶
type ListInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
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 group CI/CD variables. The OrderBy, Sort, and embedded KeysetPaginationInput fields mirror the SDK gitlab.ListGroupVariablesOptions (its embedded gitlab.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 group CI/CD variables.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of CI/CD variables for a GitLab group.
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"`
Hidden bool `json:"hidden"`
Raw bool `json:"raw"`
EnvironmentScope string `json:"environment_scope"`
Description string `json:"description"`
}
Output represents a single group CI/CD variable.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new CI/CD variable in a GitLab group.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update modifies an existing group CI/CD variable.
type UpdateInput ¶
type UpdateInput struct {
GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
Key string `json:"key" jsonschema:"Variable key name,required"`
Value string `json:"value,omitempty" jsonschema:"Updated variable value"`
Description string `json:"description,omitempty" jsonschema:"Updated 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"`
EnvironmentScope string `json:"environment_scope,omitempty" jsonschema:"Filter by environment scope (shorthand for filter.environment_scope)"`
Filter *Filter `` /* 144-byte string literal not displayed */
}
UpdateInput holds parameters for updating a group CI/CD variable.