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

usergpgkeys

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: 9 Imported by: 0

Documentation

Overview

Package usergpgkeys implements MCP tools for GitLab user GPG key operations.

The package wraps the GitLab User GPG keys 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 user GPG key actions exposed through gitlab_user.

func FormatDeleteMarkdownString

func FormatDeleteMarkdownString(o DeleteOutput) string

FormatDeleteMarkdownString renders a GPG key deletion confirmation.

func FormatListMarkdownString

func FormatListMarkdownString(o ListOutput) string

FormatListMarkdownString renders the GPG keys on an account as the collection they are.

func FormatMarkdownString

func FormatMarkdownString(o Output) string

FormatMarkdownString renders one GPG key as a card.

Types

type AddForUserInput

type AddForUserInput struct {
	UserID int64  `json:"user_id" jsonschema:"The ID of the user,required"`
	Key    string `json:"key" jsonschema:"The armored GPG public key content,required"`
}

AddForUserInput holds parameters for adding a GPG key to a specific user.

type AddInput

type AddInput struct {
	Key string `json:"key" jsonschema:"The armored GPG public key content,required"`
}

AddInput holds parameters for adding a GPG key to the current user.

type DeleteForUserInput

type DeleteForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the GPG key to delete,required"`
}

DeleteForUserInput holds parameters for deleting a GPG key from a specific user.

type DeleteInput

type DeleteInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the GPG key to delete,required"`
}

DeleteInput holds parameters for deleting a GPG key from the current user.

type DeleteOutput

type DeleteOutput struct {
	KeyID   int64 `json:"key_id"`
	Deleted bool  `json:"deleted"`
}

DeleteOutput represents the result of deleting a GPG key.

func Delete

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

Delete deletes a GPG key from the current authenticated user.

func DeleteForUser

func DeleteForUser(ctx context.Context, client *gitlabclient.Client, input DeleteForUserInput) (DeleteOutput, error)

DeleteForUser deletes a GPG key from a specific user (admin only).

type GetForUserInput

type GetForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	KeyID  int64 `json:"key_id" jsonschema:"The ID of the GPG key,required"`
}

GetForUserInput holds parameters for retrieving a specific GPG key for a user.

type GetInput

type GetInput struct {
	KeyID int64 `json:"key_id" jsonschema:"The ID of the GPG key,required"`
}

GetInput holds parameters for retrieving a specific GPG key.

type ListForUserInput

type ListForUserInput struct {
	UserID int64 `json:"user_id" jsonschema:"The ID of the user,required"`
	toolutil.PaginationInput
}

ListForUserInput holds parameters for listing GPG keys for a specific user, and the page of them to list.

type ListInput

type ListInput struct {
	toolutil.PaginationInput
}

ListInput holds the page of the current user's GPG keys to list. GitLab pages GET /user/gpg_keys, and client-go's ListGPGKeys takes no options struct, so the page travels as a request option.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Keys       []Output                  `json:"keys"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput holds one page of GPG keys and the pagination GitLab sent with it.

func List

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

List retrieves one page of the current authenticated user's GPG keys.

func ListForUser

func ListForUser(ctx context.Context, client *gitlabclient.Client, input ListForUserInput) (ListOutput, error)

ListForUser retrieves one page of a specific user's GPG keys.

type Output

type Output struct {
	toolutil.HintableOutput
	ID        int64  `json:"id"`
	Key       string `json:"key"`
	CreatedAt string `json:"created_at,omitempty"`
}

Output represents a GPG key.

func Add

func Add(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)

Add adds a GPG key to the current authenticated user.

func AddForUser

func AddForUser(ctx context.Context, client *gitlabclient.Client, input AddForUserInput) (Output, error)

AddForUser adds a GPG key to a specific user (admin only).

func Get

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

Get retrieves a specific GPG key for the current user.

func GetForUser

func GetForUser(ctx context.Context, client *gitlabclient.Client, input GetForUserInput) (Output, error)

GetForUser retrieves a specific GPG key for a specific user.

Jump to

Keyboard shortcuts

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