releases

package
v1.0.12696-1ec7e39 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package releases is a helper to determine which binaries to download for end to end tests.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func DownloadLatest

func DownloadLatest(ctx context.Context, conf DownloadConfig) (string, error)

DownloadLatest is a helper that will download the latest test binary

Types

type DownloadConfig

type DownloadConfig struct {
	// BaseURL is the url of the file binary release file server
	BaseURL string
	// Which is the application to download
	Which string
	// Binary is the binary to download. If empty it will default to the value of Which
	Binary string
	// Pinned if set will use this version to download
	Pinned string
	// Dir is the directory to download into, if empty will default to ../bin
	Dir string
}

DownloadConfig is the configuration for the DownloadLatest helper

type Releases

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

Releases helps find the latest release and download URL for artifacts using the execution release structure.

func New

func New(baseURL string) *Releases

func (*Releases) ResolveURL

func (d *Releases) ResolveURL(ctx context.Context, rq Requirements) (string, error)

ResolveURL gets the raw download URL for a release, based on the requirements (version, OS, arch)

func (*Releases) ResolveURLs

func (d *Releases) ResolveURLs(ctx context.Context, rq Requirements) (map[string]string, error)

ResolveURLs gets the raw download URLs for all binaries of a release, based on the requirements (version, OS, arch)

func (*Releases) Version

func (d *Releases) Version(ctx context.Context) (string, error)

Version gets the latest released version of an artifact.

type Requirements

type Requirements struct {
	Version string `json:"version"`
	OS      string `json:"os"`
	Arch    string `json:"arch"`
}

Jump to

Keyboard shortcuts

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