Help us shape the future of Go! Take the 2026 Go Developer Survey

customattributes

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

action_specs.go holds what this package contributes to the canonical action catalog. The specs themselves are declared in internal/tools/adminspecs, which is the one place the gitlab_admin group is assembled; what stays here is the handler adaptation a spec routes to.

This package used to declare a full set of specs of its own that nothing ever aggregated, so they reached no surface and no validation.

Package customattributes implements MCP tools for GitLab custom attribute operations.

The package wraps the GitLab Custom attributes API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error

Delete deletes a custom attribute (admin).

func DeleteOutput

func DeleteOutput(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (toolutil.DeleteOutput, error)

DeleteOutput deletes a custom attribute and returns the canonical success message shape.

func FormatGetMarkdown

func FormatGetMarkdown(out GetOutput) string

FormatGetMarkdown renders one custom attribute as a card. The two values used to be written as bullet-less "**Key**: …" lines, which a Markdown reader runs together into one paragraph, and neither was escaped.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders custom attributes as the collection they are: one table row per key and value, with both escaped, since an attribute is written by whoever administers the instance and its key is as free-form as its value.

func FormatSetMarkdown

func FormatSetMarkdown(out SetOutput) string

FormatSetMarkdown renders the attribute the set action wrote: a set returns the object, so it is the same card its get counterpart renders.

Types

type AttributeItem

type AttributeItem struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

AttributeItem represents a single custom attribute.

type DeleteInput

type DeleteInput struct {
	ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
	ResourceID   int64  `json:"resource_id" jsonschema:"ID of the resource,required"`
	Key          string `json:"key" jsonschema:"Attribute key to delete,required"`
}

DeleteInput is the input for deleting a custom attribute.

type GetInput

type GetInput struct {
	ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
	ResourceID   int64  `json:"resource_id" jsonschema:"ID of the resource,required"`
	Key          string `json:"key" jsonschema:"Attribute key,required"`
}

GetInput is the input for getting a custom attribute.

type GetOutput

type GetOutput struct {
	toolutil.HintableOutput
	AttributeItem
}

GetOutput is the output for getting a custom attribute.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (GetOutput, error)

Get gets a single custom attribute by key (admin).

type ListInput

type ListInput struct {
	ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
	ResourceID   int64  `json:"resource_id" jsonschema:"ID of the resource,required"`
}

ListInput is the input for listing custom attributes.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Attributes []AttributeItem `json:"attributes"`
}

ListOutput is the output for listing custom attributes.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List lists custom attributes for a resource (admin).

type SetInput

type SetInput struct {
	ResourceType string `json:"resource_type" jsonschema:"Resource type: user, group, or project,required"`
	ResourceID   int64  `json:"resource_id" jsonschema:"ID of the resource,required"`
	Key          string `json:"key" jsonschema:"Attribute key,required"`
	Value        string `json:"value" jsonschema:"Attribute value,required"`
}

SetInput is the input for setting a custom attribute.

type SetOutput

type SetOutput struct {
	toolutil.HintableOutput
	AttributeItem
}

SetOutput is the output for setting a custom attribute.

func Set

func Set(ctx context.Context, client *gitlabclient.Client, input SetInput) (SetOutput, error)

Set sets (creates or updates) a custom attribute (admin).

Jump to

Keyboard shortcuts

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