gitlab

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.77.0

type Client struct {
	// contains filtered or unexported fields
}

Client publishes GitLab releases over the REST API (ADR-0069).

func NewClient added in v0.77.0

func NewClient(baseURL, token string, jobToken bool) (*Client, error)

NewClient builds a client for baseURL (instance root, optionally with a relative URL root). With jobToken the token is sent as JOB-TOKEN (CI_JOB_TOKEN), otherwise as PRIVATE-TOKEN.

func (*Client) CreateRelease added in v0.77.0

func (c *Client) CreateRelease(project, tag, notes string, files []string) error

CreateRelease uploads each file to the project's Generic Packages registry, then creates the release for tag with one package link per file. Uploads come first so a failed upload leaves no asset-less release behind. POST /uploads is not used: it rejects CI_JOB_TOKEN, the Generic Packages API accepts it. Each link's direct_asset_path keeps the public download URL (.../releases/<tag>/downloads/<file>) independent of the package version.

func (*Client) VerifyReleasesAccess added in v0.77.0

func (c *Client) VerifyReleasesAccess(project string) error

VerifyReleasesAccess checks that the token can read the project's releases, the API CI_JOB_TOKEN is documented to reach. project is a path or a numeric ID.

func (*Client) VerifyUser added in v0.77.0

func (c *Client) VerifyUser() error

VerifyUser checks a personal token with GET /user. A job token cannot call it (401), so a CI run uses VerifyReleasesAccess instead.

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

Platform implements port.Platform for GitLab over the REST API (ADR-0069).

func New

func New(cfg *config.Platform) *Platform

New constructs a GitLab Platform.

func (*Platform) Check

func (p *Platform) Check() error

Check verifies a token is available, the project is resolvable, and the token authenticates against the GitLab API.

func (*Platform) CreateRelease

func (p *Platform) CreateRelease(tag, notes string, prerelease bool) error

CreateRelease uploads the resolved asset files and creates the release (Client.CreateRelease). Asset globs resolve leniently, as on GitHub: a pattern matching nothing warns and is skipped. prerelease is accepted to satisfy the shared port.Platform contract and ignored — GitLab releases have no pre-release concept (ADR-0064).

func (*Platform) HasAssets

func (p *Platform) HasAssets() bool

func (*Platform) LinkContext added in v0.24.0

func (p *Platform) LinkContext() port.LinkContext

LinkContext resolves this platform's link coordinates. GitLab projects may be nested (group/subgroup/project), so the path splits on the last slash: everything before is the owner (namespace), the final segment is the repo. BaseURL falls back to the default host when unset (e.g. a config that was not run through the loader's normalize step).

func (*Platform) Name

func (p *Platform) Name() string

func (*Platform) ReleaseURL

func (p *Platform) ReleaseURL(tag string) string

func (*Platform) ReleaseURLFromContext added in v0.36.5

func (p *Platform) ReleaseURLFromContext(tag string, lc *port.LinkContext) string

ReleaseURLFromContext builds the release URL from a pre-resolved link context so the displayed URL stays consistent with the one used to generate release notes (ADR-0022). Ambient contexts carry the full project URL in BaseURL (Owner/Repo empty); platform contexts carry the host in BaseURL with Owner and Repo set separately.

Jump to

Keyboard shortcuts

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