Documentation
¶
Overview ¶
Package gitlab provides functionality to interact with GitLab repositories, releases, and assets via the GitLab API. It includes utilities for filtering and retrieving release information, assets, and repository metadata.
The main types and functions in this package include:
- Asset: Represents a GitLab release asset with name, URL, and content type.
- Assets: A collection of Asset objects with filtering methods.
- Release: Represents a GitLab release containing a tag, name, and assets.
- Repository: Represents a GitLab repository, with methods for retrieving releases, assets, and repository details.
- NewClient: Creates a new GitLab API client.
- NewRepository: Creates a new Repository instance for accessing repository data.
This package uses the official GitLab client (gitlab.com/gitlab-org/api/client-go) for making API calls and provides additional utilities to handle GitLab data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromRepositoryRelease ¶ added in v0.1.15
FromRepositoryRelease converts a GitLab repository release to a shared Release object.
Types ¶
type Repository ¶
Repository represents a GitLab repository with its owner and name. It contains a GitLab client for making API calls.
func NewRepository ¶
func NewRepository(namespace, repo string, client *gitlab.Client) *Repository
NewRepository creates a new instance of Repository. It requires the repository owner, repository name, and a GitLab client.
func (*Repository) GetLatestIncludingPreRelease ¶
func (g *Repository) GetLatestIncludingPreRelease(ctx context.Context, perPage int) (*release.Release, error)
GetLatestIncludingPreRelease retrieves the most recently published release for the repository, including pre-releases. This returns the newest release by published date, regardless of whether it's a regular release or pre-release.
func (*Repository) GetRelease ¶
GetRelease retrieves a specific release for the repository based on the provided tag.
func (*Repository) LatestRelease ¶
LatestRelease retrieves the latest release for the repository.