edition

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package edition defines the GitLab licensing tier model used to gate tool availability across the MCP server.

GitLab licensing has three nested tiers — Free ⊂ Premium ⊂ Ultimate. A given instance exposes the union of features available at its tier. The MCP server uses Tier both for the resolved instance tier (configured or detected) and, in later phases, for the minimum required tier of each action.

The zero value of Tier is Free, the most conservative tier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tier

type Tier int

Tier is a GitLab licensing tier. Tiers are totally ordered and nested: Free < Premium < Ultimate. The zero value is Free.

const (
	// Free is the GitLab Free/CE tier. It is the zero value and the
	// conservative fallback when the instance tier cannot be determined.
	Free Tier = iota
	// Premium is the GitLab Premium tier (a superset of Free).
	Premium
	// Ultimate is the GitLab Ultimate tier (a superset of Premium).
	Ultimate
)

func ParseTier

func ParseTier(s string) (tier Tier, ok bool)

ParseTier maps a configuration string to a Tier. It is case-insensitive and trims surrounding whitespace. Accepted values:

The empty string and any other value are reported as unrecognized via ok=false; callers decide how to handle that (e.g. fall back to detection or Free).

func TierForEnterprise

func TierForEnterprise(enterprise bool) Tier

TierForEnterprise bridges the legacy binary "enterprise" notion to the 3-tier model: true maps to Ultimate (show all Premium/Ultimate tools) and false to Free. It is used by tooling and tests that predate explicit tier selection and only distinguish CE from "all enterprise".

func TierFromEdition

func TierFromEdition(edition string) Tier

TierFromEdition maps an action's Edition metadata string to the minimum licensing Tier required to use that action. Edition is the per-action minimum-tier annotation carried on the canonical action catalog. The mapping is case-insensitive and whitespace-trimmed:

"core" is the legacy CE/Free marker and maps to Free. An empty Edition is the common case (Free) and the zero value, so an unannotated action is available in every tier.

func TierFromPlan

func TierFromPlan(plan string) Tier

TierFromPlan maps a GitLab license plan name (as returned by the License API's Plan field) to a Tier. The mapping follows GitLab's tier model, including legacy plan names:

  • "premium", "starter", "bronze", "silver" → Premium
  • "ultimate", "gold" → Ultimate
  • anything else (incl. "free", "", unknown) → Free

Legacy paid plans (starter/bronze/silver) predate the Free/Premium/Ultimate rename; they are mapped to Premium because their feature set corresponds to the modern Premium tier. "gold" was the legacy name for Ultimate.

func (Tier) AtLeast

func (t Tier) AtLeast(other Tier) bool

AtLeast reports whether t is at least as high as other in the tier ordering (Free < Premium < Ultimate). It is used to decide whether an instance at tier t satisfies a minimum required tier.

func (Tier) IsEnterprise

func (t Tier) IsEnterprise() bool

IsEnterprise reports whether t is an Enterprise (Premium or Ultimate) tier. This derives the legacy binary "enterprise" notion from the 3-tier model so existing positional gating continues to behave identically.

func (Tier) String

func (t Tier) String() string

String returns the lowercase canonical name of the tier.

Jump to

Keyboard shortcuts

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