version

package
v1.5.6 Latest Latest
Warning

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

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

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 added in v1.5.0

func OSRelease() ([]byte, error)

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

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 added in v1.4.0

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