version

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: BSD-3-Clause Imports: 8 Imported by: 54

Documentation

Overview

Package version provides the version that the binary was built at.

Index

Constants

View Source
const ExtraGitCommit = ""

ExtraGitCommit, if non-empty, is the git commit of a "supplemental" repository at which Tailscale was built. Its format is the same as gitCommit.

ExtraGitCommit is used to track the source revision when the main Tailscale repository is integrated into and built from another repository (for example, Tailscale's proprietary code, or the Android OSS repository). Together, GitCommit and ExtraGitCommit exactly describe what repositories and commits were used in a build.

View Source
const GitCommit = ""

GitCommit, if non-empty, is the git commit of the github.com/tailscale/tailscale repository at which Tailscale was built. Its format is the one returned by `git describe --always --exclude "*" --dirty --abbrev=200`.

View Source
const LONG = Long

LONG is a deprecated alias for Long. Don't use it.

View Source
const Long = "date.20210104"

Long is a full version number for this build, of the form "x.y.z-commithash", or "date.yyyymmdd" if no actual version was provided.

View Source
const SHORT = Short

SHORT is a deprecated alias for Short. Don't use it.

View Source
const Short = Long

Short is a short version number for this build, of the form "x.y.z", or "date.yyyymmdd" if no actual version was provided.

Variables

This section is empty.

Functions

func AtLeast added in v0.100.0

func AtLeast(version string, minimum string) bool

AtLeast returns whether version is at least the specified minimum version.

Version comparison in Tailscale is a little complex, because we switched "styles" a few times, and additionally have a completely separate track of version numbers for OSS-only builds.

AtLeast acts conservatively, returning true only if it's certain that version is at least minimum. As a result, it can produce false negatives, for example when an OSS build supports a given feature, but AtLeast is called with an official release number as the minimum

version and minimum can both be either an official Tailscale version numbers (major.minor.patch-extracommits-extrastring), or an OSS build datestamp (date.YYYYMMDD). For Tailscale version numbers, AtLeast also accepts a prefix of a full version, in which case all missing fields are assumed to be zero.

func CmdName

func CmdName() string

CmdName returns either the base name of the current binary using os.Executable. If os.Executable fails (it shouldn't), then "cmd" is returned.

func IsMobile

func IsMobile() bool

IsMobile reports whether this is a mobile client build.

func OS added in v0.98.0

func OS() string

OS returns runtime.GOOS, except instead of returning "darwin" it returns "iOS" or "macOS".

func String added in v1.2.0

func String() string

Types

This section is empty.

Directories

Path Synopsis
Package distro reports which distro we're running on.
Package distro reports which distro we're running on.

Jump to

Keyboard shortcuts

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