license

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package license implements MCP tools for GitLab License 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 removes a license by ID.

func FormatAddMarkdown

func FormatAddMarkdown(output AddOutput) *mcp.CallToolResult

FormatAddMarkdown formats an AddOutput.

func FormatGetMarkdown

func FormatGetMarkdown(output GetOutput) *mcp.CallToolResult

FormatGetMarkdown formats a GetOutput.

func FormatLicenseMarkdown

func FormatLicenseMarkdown(item Item) *mcp.CallToolResult

FormatLicenseMarkdown formats a license as markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all license tools on the MCP server.

Types

type AddInput

type AddInput struct {
	License string `json:"license" jsonschema:"The license string (Base64-encoded),required"`
}

AddInput represents the input for adding a license.

type AddOnsItem

type AddOnsItem struct {
	GitLabAuditorUser int64 `json:"gitlab_auditor_user"`
	GitLabDeployBoard int64 `json:"gitlab_deploy_board"`
	GitLabFileLocks   int64 `json:"gitlab_file_locks"`
	GitLabGeo         int64 `json:"gitlab_geo"`
	GitLabServiceDesk int64 `json:"gitlab_service_desk"`
}

AddOnsItem represents the add-ons of a GitLab license.

type AddOutput

type AddOutput struct {
	toolutil.HintableOutput
	License Item `json:"license"`
}

AddOutput wraps the added license.

func Add

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

Add adds a new license.

type DeleteInput

type DeleteInput struct {
	ID int64 `json:"id" jsonschema:"License ID to delete,required"`
}

DeleteInput represents the input for deleting a license.

type GetInput

type GetInput struct{}

GetInput is empty (no params needed).

type GetOutput

type GetOutput struct {
	toolutil.HintableOutput
	License Item `json:"license"`
}

GetOutput wraps the license.

func Get

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

Get retrieves the current license information.

type Item

type Item struct {
	ID               int64        `json:"id"`
	Plan             string       `json:"plan"`
	CreatedAt        string       `json:"created_at,omitempty"`
	StartsAt         string       `json:"starts_at,omitempty"`
	ExpiresAt        string       `json:"expires_at,omitempty"`
	HistoricalMax    int64        `json:"historical_max"`
	MaximumUserCount int64        `json:"maximum_user_count"`
	Expired          bool         `json:"expired"`
	Overage          int64        `json:"overage"`
	UserLimit        int64        `json:"user_limit"`
	ActiveUsers      int64        `json:"active_users"`
	Licensee         LicenseeItem `json:"licensee"`
	AddOns           AddOnsItem   `json:"add_ons"`
}

Item represents a GitLab license.

type LicenseeItem

type LicenseeItem struct {
	Name    string `json:"name"`
	Company string `json:"company"`
	Email   string `json:"email"`
}

LicenseeItem represents the licensee of a GitLab license.

Jump to

Keyboard shortcuts

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