direct

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package direct provides a release.Provider implementation for tools distributed via arbitrary HTTP servers. Asset URLs are constructed from a configurable template; version detection is optional and supports plain text, JSON, YAML, and XML endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectReleaseProvider

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

DirectReleaseProvider implements release.Provider for direct HTTP downloads.

func NewReleaseProvider

NewReleaseProvider constructs a DirectReleaseProvider from a ReleaseSourceConfig.

Required Params key: url_template. Optional Params keys: version_url, version_format, version_key, pinned_version, checksum_url_template.

Token resolution: cfg key "direct.token", then DIRECT_TOKEN env var.

func (*DirectReleaseProvider) DownloadReleaseAsset

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

DownloadReleaseAsset downloads the asset at its BrowserDownloadURL.

func (*DirectReleaseProvider) GetLatestRelease

func (p *DirectReleaseProvider) GetLatestRelease(ctx context.Context, _, _ string) (release.Release, error)

GetLatestRelease fetches the latest version from the version endpoint and returns a synthetic release. Returns ErrVersionUnknown if no version source is configured.

func (*DirectReleaseProvider) GetReleaseByTag

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

GetReleaseByTag constructs a synthetic release for the given tag without any network call.

func (*DirectReleaseProvider) ListReleases

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

ListReleases is not supported for direct HTTP providers.

func (*DirectReleaseProvider) SetToolName

func (p *DirectReleaseProvider) SetToolName(name string)

SetToolName sets the tool name used in URL template expansion. This is called by the setup package when the Props.Tool.Name is available.

Jump to

Keyboard shortcuts

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