version

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MPL-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package version defines version information.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Name is set at build time.
	Name = gendata.VersionName
	// Tag is set at build time.
	Tag = gendata.VersionTag
	// SHA is set at build time.
	SHA = gendata.VersionSHA
	// Built is set at build time.
	// TODO: its not.
	Built string
	// PkgsVersion is set at build time.
	PkgsVersion = gendata.VersionPkgs
	// ExtrasVersion is set at build time.
	ExtrasVersion = gendata.VersionExtras
)

Functions

func NewVersion

func NewVersion() *machineapi.VersionInfo

NewVersion prints verbose version information.

func OSRelease

func OSRelease() ([]byte, error)

OSRelease returns the contents of /etc/os-release.

func OSReleaseFor

func OSReleaseFor(name, version string) ([]byte, error)

OSReleaseFor returns the contents of /etc/os-release for a given name and version.

func PrintLongVersion

func PrintLongVersion()

PrintLongVersion prints verbose version information.

func PrintLongVersionFromExisting

func PrintLongVersionFromExisting(v *machineapi.VersionInfo)

PrintLongVersionFromExisting prints verbose version information.

func PrintShortVersion

func PrintShortVersion()

PrintShortVersion prints the tag and SHA.

func Short

func Short() string

Short returns the short version string consist of name, tag and SHA.

func Trim

func Trim(version string) string

Trim removes anything extra after semantic version core, `v0.3.2-1-abcd` -> `v0.3.2`.

func WriteLongVersionFromExisting

func WriteLongVersionFromExisting(w io.Writer, v *machineapi.VersionInfo)

WriteLongVersionFromExisting writes verbose version to io.Writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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