Documentation ¶
Index ¶
- Constants
- Variables
- func Contains(locator Locator, locators []Locator) bool
- func GreaterOrEqualPatch(left, right semver.Version) bool
- func IsLegacyRuntimePackage(loc Locator) bool
- func IsSameApp(app1, app2 Locator) bool
- func IsUpdate(update Locator, installed []Locator) (bool, error)
- type Digest
- type DockerImage
- type DockerImages
- type Locator
- func Deduplicate(ls []Locator) (result []Locator)
- func Filter(locators []Locator, filters []Locator, message string) (result []Locator)
- func MakeLocator(app string) (*Locator, error)
- func MakeLocatorWithDefault(app string, defaultVersion defaultVersionFunc) (*Locator, error)
- func MustCreateLocator(repo, name, ver string) Locator
- func MustParseLocator(v string) Locator
- func NewLocator(repository, name, ver string) (*Locator, error)
- func ParseLocator(v string) (*Locator, error)
- func (l *Locator) IsEmpty() bool
- func (l Locator) IsEqualTo(other Locator) bool
- func (l *Locator) IsNewerThan(other Locator) (bool, error)
- func (l *Locator) SemVer() (*semver.Version, error)
- func (l *Locator) Set(v string) error
- func (l Locator) String() string
- func (l Locator) WithLiteralVersion(version string) Locator
- func (l Locator) WithVersion(version *semver.Version) Locator
- func (l *Locator) ZeroVersion() Locator
- type Locators
Constants ¶
const ( // ZeroVersion is a special "zero" package version that means "no particular version" ZeroVersion = "0.0.0" // FirstVersion is a special package version that indicates the initial package version FirstVersion = "0.0.1" // LatestVersion defines a special placeholder for greatest available version LatestVersion = "0.0.0+latest" // StableVersion defines a special placeholder for the latest stable version StableVersion = "0.0.0+stable" )
Variables ¶
var ( // OpsCenterCertificateAuthority is locator for the package containing certificate and private // key for the OpsCenter OpsCenterCertificateAuthority = MustParseLocator( fmt.Sprintf("%v/%v:0.0.1", defaults.SystemAccountOrg, constants.OpsCenterCAPackage)) // Runtime is the default runtime application locator Runtime = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, defaults.Runtime, LatestVersion)) // Bandwagon is the bandwagon application locator Bandwagon = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, defaults.BandwagonPackageName, LatestVersion)) // Planet is the planet package locator Planet = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, constants.PlanetPackage, ZeroVersion)) // Teleport is the teleport package locator Teleport = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, constants.TeleportPackage, ZeroVersion)) // Gravity is the gravity binary package locator Gravity = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, constants.GravityPackage, ZeroVersion)) // Fio is the fio binary package locator Fio = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, constants.FioPackage, ZeroVersion)) // TrustedCluster is the trusted-cluster package locator TrustedCluster = MustParseLocator( fmt.Sprintf("%v/%v:0.0.1", defaults.SystemAccountOrg, constants.TrustedClusterPackage)) // RPCSecrets defines a package with RPC agent credentials // that the wizard and cluster controller create. // The credentials are then pulled by agents that participate in installation // and join/leave operations. RPCSecrets = MustParseLocator( fmt.Sprintf("%v/%v:0.0.1", defaults.SystemAccountOrg, defaults.RPCAgentSecretsPackage)) // LegacyPlanetMaster is the package locator for legacy planet master packages LegacyPlanetMaster = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, "planet-master", ZeroVersion)) // LegacyPlanetNode is the package locator for legacy planet node packages LegacyPlanetNode = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, "planet-node", ZeroVersion)) // WebAssetsPackageLocator is the package with web assets WebAssetsPackageLocator = MustParseLocator( fmt.Sprintf("%v/%v:%v", defaults.SystemAccountOrg, "web-assets", ZeroVersion)) )
Functions ¶
func GreaterOrEqualPatch ¶
GreaterOrEqualPatch returns true if the left version has the same major/minor components as the right version but a greater or equal patch component.
func IsLegacyRuntimePackage ¶
IsLegacyRuntimePackage returns true if the specified package envelope describes a legacy runtime package TODO: remove when there's no more need to take legacy runtime packages into account
Types ¶
type DockerImage ¶
type DockerImage struct { Registry string `json:"registry"` Repository string `json:"repository"` Tag string `json:"tag"` Digest string `json:"digest"` }
func ParseDockerImage ¶
func ParseDockerImage(image string) (*DockerImage, error)
func (*DockerImage) String ¶
func (d *DockerImage) String() string
String returns the string representation of the DockerImage. Format: [Registry/]Repository[:Tag][@Digest]
type DockerImages ¶
type DockerImages []DockerImage
DockerImages represent a slice of DockerImage.
func ImagesSlice ¶
func ImagesSlice(s kingpin.Settings) *DockerImages
ImagesSlice creates a collection of DockerImages from a kingpin command line argument.
func (*DockerImages) IsCumulative ¶
func (*DockerImages) IsCumulative() bool
IsCumulative indicates that DockerImages is a cumulative argument.
func (*DockerImages) Set ¶
func (i *DockerImages) Set(v string) error
Set sets the value of a DockerImage if the supplied string is a valid image locator, returning any errors encountered.
func (*DockerImages) String ¶
func (i *DockerImages) String() string
String returns a string representation of the DockerImages type.
type Locator ¶
type Locator struct { Repository string `json:"repository"` // package software repository Name string `json:"name"` // example: "planet-dev" Version string `json:"version"` // example: "0.0.36" }
Locator is a unique package locator. It consists of the name and version in the form of sem ver
func Deduplicate ¶
Deduplicate returns ls with duplicates removed
func Filter ¶
Filter filters a list of locators. Excludes the values specified in []filters from []locators.
func MakeLocator ¶
MakeLocator takes an app package and makes a locator out of it:
- if it's in the 'repo/name:ver' format, returns it
- if it's in the 'name:ver' format, returns locator with system repo (systemrepo/name:ver)
- if it's in the 'name' format, returns locator with system repo and latest meta-version (systemrepo/name:0.0.0+latest)
func MakeLocatorWithDefault ¶
MakeLocatorWithDefault is like MakeLocator but uses the provided default version if the one isn't specified explicitly, instead of defaulting to the latest.
func MustCreateLocator ¶
MustCreateLocator creates new locator from parts or panics
func MustParseLocator ¶
func NewLocator ¶
func ParseLocator ¶
func (*Locator) IsNewerThan ¶
IsNewerThan returns true if this locator is of greater version than the provided locator
func (Locator) WithLiteralVersion ¶
WithLiteralVersion returns a copy of this locator with version set to the specified one
func (Locator) WithVersion ¶
WithVersion returns a copy of this locator with version set to the specified one
func (*Locator) ZeroVersion ¶
ZeroVersion returns a special 0.0.0 version of the package
type Locators ¶
type Locators []Locator
Locators represents a list of package locators.
func LocatorSlice ¶
func LocatorSlice(s kingpin.Settings) *Locators
LocatorSlice creates a collection of Locators from a kingpin command line argument.
func (*Locators) IsCumulative ¶
IsCumulative indicates that Locators is a cumulative argument.