distro

package
v0.0.0-...-110224e Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WindowsServerVersionforNTVersion

func WindowsServerVersionforNTVersion(major string, minor string) (marketingMajor, marketingMinor string, err error)

WindowsServerVersionforNTVersion returns the marketing version corresponding to an NT version.

Careful: NT versions are shared across multiple Windows products, so this function is a rough heuristic. It follows these rules for a collision:

  • Only returns server versions (not desktop).
  • If multiple server versions are possible, return the earliest.

Types

type Release

type Release interface {
	// ImportCompatible returns whether a distro considers two releases
	// compatible. As an example, different minor versions in Ubuntu are typically
	// not compatible, while different minor versions in centOS are.
	ImportCompatible(other Release) bool

	// AsGcloudArg returns a hyphenated identifier, as used in the `--os` flag
	// of `gcloud compute images import`. It is intended for
	// showing to users in a help message. Notably, it lacks support for
	// the -byol suffix, as that is not currently modeled.
	AsGcloudArg() string
}

Release encapsulates product and version information about the operating systems we support.

func FromComponents

func FromComponents(distro string, major string, minor string, architecture string) (r Release, e error)

FromComponents interprets the (distro, major, minor) tuple and returns a Release if the arguments are syntactically correct, and represent a release that we *may* support. The caller is responsible for verifying whether a translator is available elsewhere in the system.

func FromGcloudOSArgument

func FromGcloudOSArgument(osFlagValue string) (r Release, e error)

FromGcloudOSArgument parses the argument provided to the `--os` flag of `gcloud compute images import`, and returns a Release if it represents a release we *may* support. The caller is responsible for verifying whether a translator is available elsewhere in the system.

https://cloud.google.com/sdk/gcloud/reference/compute/images/import#--os

func FromGcloudOSArgumentMustParse

func FromGcloudOSArgumentMustParse(osFlagValue string) Release

FromGcloudOSArgumentMustParse parses the argument provided to the `--os` flag of `gcloud compute images import`, and returns a Release if it represents a release we *may* support. If osFlagValue does not parse, the call panics.

Jump to

Keyboard shortcuts

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