releasesjson

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MPL-2.0 Imports: 20 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() (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, dstDir string) 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"`
	RawVersion  string           `json:"version"`
	Version     *version.Version `json:"-"`
	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)

Jump to

Keyboard shortcuts

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