deploytokens

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package deploytokens implements MCP tools for GitLab project and group deploy token operations.

The package wraps the GitLab Deploy tokens 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 deploy token actions.

func DeleteGroup

func DeleteGroup(ctx context.Context, client *gitlabclient.Client, input DeleteGroupInput) error

DeleteGroup deletes a group deploy token.

func DeleteGroupOutput

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

DeleteGroupOutput deletes a group deploy token and returns the canonical success message shape.

func DeleteProject

func DeleteProject(ctx context.Context, client *gitlabclient.Client, input DeleteProjectInput) error

DeleteProject deletes a project deploy token.

func DeleteProjectOutput

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

DeleteProjectOutput deletes a project deploy token and returns the canonical success message shape.

func FormatListMarkdown

func FormatListMarkdown(o ListOutput) string

FormatListMarkdown formats a list of deploy tokens.

func FormatOutputMarkdown

func FormatOutputMarkdown(o Output) string

FormatOutputMarkdown formats a single deploy token.

Types

type CreateGroupInput

type CreateGroupInput struct {
	GroupID   toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	Name      string               `json:"name" jsonschema:"Deploy token name,required"`
	ExpiresAt string               `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
	Username  string               `json:"username,omitempty" jsonschema:"Username for the deploy token"`
	Scopes    []string             `` /* 138-byte string literal not displayed */
}

CreateGroupInput represents parameters for creating a group deploy token.

type CreateProjectInput

type CreateProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Name      string               `json:"name" jsonschema:"Deploy token name,required"`
	ExpiresAt string               `json:"expires_at,omitempty" jsonschema:"Expiry date (YYYY-MM-DD)"`
	Username  string               `json:"username,omitempty" jsonschema:"Username for the deploy token"`
	Scopes    []string             `` /* 138-byte string literal not displayed */
}

CreateProjectInput represents parameters for creating a project deploy token.

type DeleteGroupInput

type DeleteGroupInput struct {
	GroupID       toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	DeployTokenID int64                `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}

DeleteGroupInput represents parameters for deleting a group deploy token.

type DeleteProjectInput

type DeleteProjectInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	DeployTokenID int64                `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}

DeleteProjectInput represents parameters for deleting a project deploy token.

type GetGroupInput

type GetGroupInput struct {
	GroupID       toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	DeployTokenID int64                `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}

GetGroupInput represents parameters for getting a group deploy token.

type GetProjectInput

type GetProjectInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	DeployTokenID int64                `json:"deploy_token_id" jsonschema:"Deploy token ID,required"`
}

GetProjectInput represents parameters for getting a project deploy token.

type ListAllInput

type ListAllInput struct{}

ListAllInput represents parameters for listing all instance deploy tokens.

type ListGroupInput

type ListGroupInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
	Page    int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage int                  `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}

ListGroupInput represents parameters for listing group deploy tokens.

type ListOutput

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

ListOutput holds a paginated list of deploy tokens.

func ListAll

func ListAll(ctx context.Context, client *gitlabclient.Client, _ ListAllInput) (ListOutput, error)

ListAll lists all instance-level deploy tokens.

func ListGroup

func ListGroup(ctx context.Context, client *gitlabclient.Client, input ListGroupInput) (ListOutput, error)

ListGroup lists deploy tokens for a group.

func ListProject

func ListProject(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListOutput, error)

ListProject lists deploy tokens for a project.

type ListProjectInput

type ListProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Page      int                  `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage   int                  `json:"per_page,omitempty" jsonschema:"Results per page (max 100)"`
}

ListProjectInput represents parameters for listing project deploy tokens.

type Output

type Output struct {
	toolutil.HintableOutput
	ID        int64    `json:"id"`
	Name      string   `json:"name"`
	Username  string   `json:"username"`
	ExpiresAt string   `json:"expires_at,omitempty"`
	Revoked   bool     `json:"revoked"`
	Expired   bool     `json:"expired"`
	Token     string   `json:"token,omitempty"`
	Scopes    []string `json:"scopes"`
}

Output represents a GitLab deploy token.

func CreateGroup

func CreateGroup(ctx context.Context, client *gitlabclient.Client, input CreateGroupInput) (Output, error)

CreateGroup creates a deploy token for a group.

func CreateProject

func CreateProject(ctx context.Context, client *gitlabclient.Client, input CreateProjectInput) (Output, error)

CreateProject creates a deploy token for a project.

func GetGroup

func GetGroup(ctx context.Context, client *gitlabclient.Client, input GetGroupInput) (Output, error)

GetGroup retrieves a specific group deploy token.

func GetProject

func GetProject(ctx context.Context, client *gitlabclient.Client, input GetProjectInput) (Output, error)

GetProject retrieves a specific project deploy token.

Jump to

Keyboard shortcuts

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