gitlab

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitLabSource

func NewGitLabSource(config source.Config) source.Source

NewGitLabSource creates a new GitLab source

Types

type GitLabAssetLink struct {
	Id              int    `json:"id"`
	Name            string `json:"name"`
	Url             string `json:"url"`
	LinkType        string `json:"link_type"`
	DirectAssetPath string `json:"direct_asset_path"`
}

GitLabAssetLink models uploaded asset links in release response

type GitLabAssetSource

type GitLabAssetSource struct {
	Format string `json:"format"`
	Url    string `json:"url"`
}

GitLabAssetSource models archive sources in release response

type GitLabReleaseResponse

type GitLabReleaseResponse struct {
	TagName     string `json:"tag_name"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Assets      struct {
		Count   int                 `json:"count"`
		Sources []GitLabAssetSource `json:"sources"`
		Links   []GitLabAssetLink   `json:"links"`
	} `json:"assets"`
}

GitLabReleaseResponse models GitLab API /projects/:id/releases/:tag response

type GitLabSource

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

GitLabSource implements source.Source for GitLab

func (*GitLabSource) DownloadReleaseAsset

func (s *GitLabSource) DownloadReleaseAsset(repo source.Repo, asset source.ReleaseAsset, destPath string, withProgress bool) error

DownloadReleaseAsset downloads a release asset to destPath

func (*GitLabSource) DownloadSourceZip

func (s *GitLabSource) DownloadSourceZip(repo source.Repo, gitRef string) (string, error)

DownloadSourceZip downloads repo archive for a git ref and returns temp file path

func (*GitLabSource) FetchTags

func (s *GitLabSource) FetchTags(repoUrl, token string) ([]string, error)

FetchTags returns all semver tags from the repository

func (*GitLabSource) GetReleaseInfo

func (s *GitLabSource) GetReleaseInfo(repo source.Repo, tag string) (source.Release, error)

GetReleaseInfo returns release information for a specific tag

func (*GitLabSource) MakeArchiveRequest

func (s *GitLabSource) MakeArchiveRequest(commit source.Commit, token string) (*http.Request, error)

MakeArchiveRequest creates HTTP request to download repo archive

func (*GitLabSource) ParseUrl

func (s *GitLabSource) ParseUrl(repoUrl, token string) (source.Repo, error)

ParseUrl parses a GitLab repo URL into a Repo struct Supports nested subgroups: gitlab.com/group/subgroup/project

func (*GitLabSource) Type

func (s *GitLabSource) Type() source.SourceType

Type returns the source type

type GitLabTagResponse

type GitLabTagResponse struct {
	Name   string `json:"name"`
	Commit struct {
		Id string `json:"id"`
	} `json:"commit"`
}

GitLabTagResponse models GitLab API /projects/:id/repository/tags response

Jump to

Keyboard shortcuts

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