Documentation
¶
Overview ¶
markdown.go provides Markdown formatting functions for user GPG key MCP tool output.
register.go wires GPG key MCP tools to the MCP server.
Package usergpgkeys implements GitLab GPG key management operations for users.
Index ¶
- func FormatDeleteMarkdownString(o DeleteOutput) string
- func FormatListMarkdownString(o ListOutput) string
- func FormatMarkdownString(o Output) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type AddForUserInput
- type AddInput
- type DeleteForUserInput
- type DeleteInput
- type DeleteOutput
- type GetForUserInput
- type GetInput
- type ListForUserInput
- type ListInput
- type ListOutput
- type Output
- func Add(ctx context.Context, client *gitlabclient.Client, input AddInput) (Output, error)
- func AddForUser(ctx context.Context, client *gitlabclient.Client, input AddForUserInput) (Output, error)
- func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- func GetForUser(ctx context.Context, client *gitlabclient.Client, input GetForUserInput) (Output, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDeleteMarkdownString ¶
func FormatDeleteMarkdownString(o DeleteOutput) string
FormatDeleteMarkdownString renders a GPG key deletion confirmation.
func FormatListMarkdownString ¶
func FormatListMarkdownString(o ListOutput) string
FormatListMarkdownString renders a GPG key list as a Markdown string.
func FormatMarkdownString ¶
FormatMarkdownString renders a single GPG key as a Markdown string.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers GPG key management tools.
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 ¶
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"`
}
ListForUserInput holds parameters for listing GPG keys for a specific user.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Keys []Output `json:"keys"`
}
ListOutput holds a list of GPG keys.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, _ ListInput) (ListOutput, error)
List retrieves GPG keys for the current authenticated user.
func ListForUser ¶
func ListForUser(ctx context.Context, client *gitlabclient.Client, input ListForUserInput) (ListOutput, error)
ListForUser retrieves GPG keys for a specific user.
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 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 GetForUser ¶
func GetForUser(ctx context.Context, client *gitlabclient.Client, input GetForUserInput) (Output, error)
GetForUser retrieves a specific GPG key for a specific user.