license

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package license implements MCP tools for GitLab instance license operations.

The package wraps the GitLab License 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 license actions exposed as MCP tools. The get, add, and delete routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func Delete

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

Delete removes a GitLab license by ID via the GitLab License API (DELETE /license/:id). Requires administrator access.

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.

Types

type AddInput

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

AddInput carries the Base64-encoded GitLab license payload to install.

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 installs a new GitLab license via the GitLab License API (POST /license). The License field must be a base64-encoded license string. Requires administrator access.

type DeleteInput

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

DeleteInput identifies the installed GitLab license to remove.

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 currently installed GitLab license via the GitLab License API (GET /license). Requires administrator access.

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