releasesjson

package
v0.0.0-...-fd0a705 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChecksumDownloader

type ChecksumDownloader struct {
	ProductVersion   *ProductVersion
	Logger           *log.Logger
	ArmoredPublicKey string

	BaseURL string
}

func (*ChecksumDownloader) DownloadAndVerifyChecksums

func (cd *ChecksumDownloader) DownloadAndVerifyChecksums(ctx context.Context) (ChecksumFileMap, error)

type ChecksumFileMap

type ChecksumFileMap map[string]HashSum

type Downloader

type Downloader struct {
	Logger           *log.Logger
	VerifyChecksum   bool
	ArmoredPublicKey string
	BaseURL          string
}

func (*Downloader) DownloadAndUnpack

func (d *Downloader) DownloadAndUnpack(ctx context.Context, pv *ProductVersion, binDir string, licenseDir string) (up *UnpackedProduct, err error)

type HashSum

type HashSum []byte

func HashSumFromHexDigest

func HashSumFromHexDigest(hexDigest string) (HashSum, error)

func (HashSum) Size

func (hs HashSum) Size() int

func (HashSum) String

func (hs HashSum) String() string

type Product

type Product struct {
	Name     string             `json:"name"`
	Versions ProductVersionsMap `json:"versions"`
}

Product is a top-level product like "Consul" or "Nomad". A Product may have one or more versions.

type ProductBuild

type ProductBuild struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	Filename string `json:"filename"`
	URL      string `json:"url"`
}

ProductBuild is an OS/arch-specific representation of a product. This is the actual file that a user would download, like "consul_0.5.1_linux_amd64".

type ProductBuilds

type ProductBuilds []*ProductBuild

func (ProductBuilds) FilterBuild

func (pbs ProductBuilds) FilterBuild(os string, arch string, suffix string) (*ProductBuild, bool)

type ProductVersion

type ProductVersion struct {
	Name        string           `json:"name"`
	Version     *version.Version `json:"version"`
	SHASUMS     string           `json:"shasums,omitempty"`
	SHASUMSSig  string           `json:"shasums_signature,omitempty"`
	SHASUMSSigs []string         `json:"shasums_signatures,omitempty"`
	Builds      ProductBuilds    `json:"builds"`
}

ProductVersion is a wrapper around a particular product version like "consul 0.5.1". A ProductVersion may have one or more builds.

type ProductVersions

type ProductVersions []*ProductVersion

func (ProductVersions) Len

func (pv ProductVersions) Len() int

func (ProductVersions) Less

func (pv ProductVersions) Less(i, j int) bool

func (ProductVersions) Swap

func (pv ProductVersions) Swap(i, j int)

type ProductVersionsMap

type ProductVersionsMap map[string]*ProductVersion

func (ProductVersionsMap) AsSlice

func (pvm ProductVersionsMap) AsSlice() ProductVersions

type Releases

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

func NewReleases

func NewReleases() *Releases

func (*Releases) GetProductVersion

func (r *Releases) GetProductVersion(ctx context.Context, product string, version *version.Version) (*ProductVersion, error)

func (*Releases) ListProductVersions

func (r *Releases) ListProductVersions(ctx context.Context, productName string) (ProductVersionsMap, error)

func (*Releases) SetLogger

func (r *Releases) SetLogger(logger *log.Logger)

type UnpackedProduct

type UnpackedProduct struct {
	PathsToRemove []string
}

Jump to

Keyboard shortcuts

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