bitbucket

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package bitbucket provides a release.Provider implementation for Bitbucket Cloud using the Downloads API. Bitbucket has no native "Releases" concept; version information is inferred from asset filenames using a configurable regular expression.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketReleaseProvider

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

BitbucketReleaseProvider implements release.Provider for Bitbucket Cloud.

func NewReleaseProvider

NewReleaseProvider constructs a BitbucketReleaseProvider.

Credentials are resolved by [resolveCredentials]; see its doc for the full precedence chain. A corrupt keychain blob aborts construction rather than silently falling through to the legacy literal step.

The filename regex can be overridden via src.Params["filename_pattern"].

func (*BitbucketReleaseProvider) DownloadChecksumManifest

func (p *BitbucketReleaseProvider) DownloadChecksumManifest(ctx context.Context, rel release.Release, maxBytes int64) ([]byte, error)

DownloadChecksumManifest implements release.ChecksumProvider by locating an uploaded `checksums.txt` by exact filename in the repository's downloads list. The filename regex used by [matchAssets] is intentionally tight around the binary pattern, so the manifest is not picked up there; this method bypasses the regex for the well-known manifest name.

Returns release.ErrNotSupported when the downloads list contains no `checksums.txt`, so the caller treats it the same as "provider has no manifest support" and respects require_checksum policy.

func (*BitbucketReleaseProvider) DownloadReleaseAsset

func (p *BitbucketReleaseProvider) DownloadReleaseAsset(ctx context.Context, _, _ string, asset release.ReleaseAsset) (io.ReadCloser, string, error)

DownloadReleaseAsset streams the asset at its BrowserDownloadURL.

func (*BitbucketReleaseProvider) GetLatestRelease

func (p *BitbucketReleaseProvider) GetLatestRelease(ctx context.Context, owner, repo string) (release.Release, error)

GetLatestRelease returns a synthetic release built from the most recently uploaded Downloads that match the filename pattern.

func (*BitbucketReleaseProvider) GetReleaseByTag

func (p *BitbucketReleaseProvider) GetReleaseByTag(_ context.Context, _, _, _ string) (release.Release, error)

GetReleaseByTag is not supported for Bitbucket Downloads.

func (*BitbucketReleaseProvider) ListReleases

func (p *BitbucketReleaseProvider) ListReleases(_ context.Context, _, _ string, _ int) ([]release.Release, error)

ListReleases is not supported for Bitbucket Downloads.

func (*BitbucketReleaseProvider) SetAPIBase

func (p *BitbucketReleaseProvider) SetAPIBase(base string)

SetAPIBase overrides the Bitbucket API base URL. Intended for testing only.

Jump to

Keyboard shortcuts

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