fetcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGhAssetNotFound = errors.New("github asset not found")
View Source
var ErrListVersionsUnsupported = errors.New("fetcher does not support listing versions")

Functions

func CompileFilter

func CompileFilter(pattern string) (*regexp.Regexp, error)

Types

type Artifact

type Artifact struct {
	Fetcher Fetcher `yaml:"fetcher"`
	Verify  Verify  `yaml:"verify"`
}

type Engine

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

func NewEngine

func NewEngine(resolver auth.Resolver) *Engine

func (*Engine) ListVersions

func (e *Engine) ListVersions(ctx context.Context, f Fetcher) ([]string, error)

func (*Engine) OpenArtifact

func (e *Engine) OpenArtifact(ctx context.Context, art *Artifact, version, sha256Override string, platform Platform) (io.ReadCloser, int64, error)

type Fetcher

type Fetcher struct {
	GitHubRelease *GitHubReleaseFetcher `yaml:"github_release,omitempty"`
	GitHubTag     *GitHubTagFetcher     `yaml:"github_tag,omitempty"`
	HTTP          *HTTPFetcher          `yaml:"http,omitempty"`
}

func (Fetcher) Validate

func (f Fetcher) Validate() error

type GitHubReleaseFetcher

type GitHubReleaseFetcher struct {
	Repo              string            `yaml:"repo"`
	AssetName         string            `yaml:"assetName"`
	TemplateOverrides map[string]string `yaml:"templateOverrides,omitempty"`
	ReleaseFilter     string            `yaml:"releaseFilter,omitempty"`
	VersionTemplate   string            `yaml:"versionTemplate,omitempty"`
	ReleaseTemplate   string            `yaml:"releaseTemplate,omitempty"`
}

func (*GitHubReleaseFetcher) Validate

func (f *GitHubReleaseFetcher) Validate() error

type GitHubReleaseVersionSource

type GitHubReleaseVersionSource struct {
	Repo            string `yaml:"repo"`
	ReleaseFilter   string `yaml:"releaseFilter,omitempty"`
	VersionTemplate string `yaml:"versionTemplate,omitempty"`
}

type GitHubTagFetcher

type GitHubTagFetcher struct {
	Repo            string `yaml:"repo"`
	TagTemplate     string `yaml:"tagTemplate,omitempty"`
	TagFilter       string `yaml:"tagFilter,omitempty"`
	VersionTemplate string `yaml:"versionTemplate,omitempty"`
}

func (*GitHubTagFetcher) RenderTag

func (f *GitHubTagFetcher) RenderTag(version string) (string, error)

func (*GitHubTagFetcher) Validate

func (f *GitHubTagFetcher) Validate() error

type GitHubTagVersionSource

type GitHubTagVersionSource struct {
	Repo            string `yaml:"repo"`
	TagFilter       string `yaml:"tagFilter,omitempty"`
	VersionTemplate string `yaml:"versionTemplate,omitempty"`
}

type HTTPFetcher

type HTTPFetcher struct {
	URL               string            `yaml:"url"`
	TemplateOverrides map[string]string `yaml:"templateOverrides,omitempty"`
	VersionsFrom      *VersionsFrom     `yaml:"versionsFrom,omitempty"`
}

type Platform

type Platform struct {
	OS   string
	Arch string
}

func CurrentPlatform

func CurrentPlatform() Platform

type Verify

type Verify struct {
	SHA256            string `yaml:"sha256,omitempty"`
	SHA256URL         string `yaml:"sha256URL,omitempty"`
	SHA256GitHubAsset string `yaml:"sha256GitHubAsset,omitempty"`
}

func (Verify) Validate

func (v Verify) Validate() error

type VersionsFrom

type VersionsFrom struct {
	GitHubRelease *GitHubReleaseVersionSource `yaml:"github_release,omitempty"`
	GitHubTag     *GitHubTagVersionSource     `yaml:"github_tag,omitempty"`
}

func (VersionsFrom) Validate

func (v VersionsFrom) Validate() error

Jump to

Keyboard shortcuts

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