version

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version declares types for each string to keep strict coupling to the JSON schema

Index

Constants

This section is empty.

Variables

View Source
var LastKnownEnvoy = Version(lastKnownEnvoy)

LastKnownEnvoy is the last known Envoy Version, used to ensure help statements aren't out-of-date. This is derived from /site/envoy-versions.json, but not used directly because go:embed requires a file read from the current directory tree.

This is different than the "latestVersion" because this is built into the binary. For example, after the binary is built, a more recent "latestVersion" can be used, even if the help statements only know about the one from compile time.

View Source
var LastKnownMinorVersionEnvoy = Version(lastKnownEnvoy[:strings.LastIndex(lastKnownEnvoy, ".")])

LastKnownMinorVersionEnvoy is LastKnownEnvoy wihout the patch component.

Functions

This section is empty.

Types

type FuncEVersions added in v1.0.0

type FuncEVersions interface {
	// Get returns a version map from a remote URL. e.g. from globals.DefaultEnvoyVersionsURL.
	Get(context.Context) (ReleaseVersions, error)

	// FindLatestPatch finds the latest patch version for the given minor version or raises an error.
	FindLatestPatch(context.Context, Version) (Version, error)
}

FuncEVersions fetches a version map from a remote URL and gets the latest patched version given a version input. This input can be major.minor.patch (e.g. 1.1.1) or major.minor (1.1).

type Platform

type Platform string

Platform encodes 'runtime.GOOS/runtime.GOARCH'. Ex "darwin/amd64"

type Release

type Release struct {
	ReleaseDate ReleaseDate

	// Tarballs are the Tarballs available by Platform
	Tarballs map[Platform]TarballURL `json:"tarballs,omitempty"`
}

Release primarily maps available Tarballs for a Version

type ReleaseDate

type ReleaseDate string

ReleaseDate is the publish date of the release Version. Ex. "2021-05-11"

type ReleaseVersions

type ReleaseVersions struct {
	// LatestVersion is the latest stable Version
	LatestVersion Version `json:"latestVersion"`
	// Versions maps a Version to its Release
	Versions map[Version]Release `json:"versions"`
	// SHA256Sums maps a Tarball to its SHA256Sum
	SHA256Sums map[Tarball]SHA256Sum `json:"sha256sums"`
}

ReleaseVersions primarily maps Version to TarballURL and tracks the LatestVersion

type SHA256Sum

type SHA256Sum string

SHA256Sum is a SHA-256 lower-hex hash. Ex. "1274f55b3022bc1331aed41089f189094e00729981fe132ce00aac6272ea0770"

type Tarball

type Tarball string

Tarball is the name of the tar.gz or tar.xz archive. Ex. "envoy-v1.18.3-linux-amd64.tar.xz" Minimum contents are "${dist}/bin/envoy[.exe]" Ex. "envoy-v1.18.3-linux-amd64/bin/envoy"

type TarballURL

type TarballURL string

TarballURL is the HTTPS URL to the Tarball. SHA256Sums must include its base name.

type Version

type Version string

Version is a release version from https://github.com/envoyproxy/envoy/releases, without a 'v' prefix. Ex "1.18.3"

func (*Version) IsDebug added in v1.0.0

func (v *Version) IsDebug() bool

IsDebug shows if the version is a debug version

func (*Version) MinorPrefix added in v1.0.0

func (v *Version) MinorPrefix() string

MinorPrefix expects the v is a valid version pattern extracts the v and returns the EnvoyStrictMinorVersionPattern without debug component e.g: 1.19.1_debug -> 1.19 note: you may need to append a dot to avoid false matching, e.g. 1.1 to 1.18.

Jump to

Keyboard shortcuts

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