Documentation
¶
Overview ¶
Package version reports the build version, set at release time with -ldflags "-X github.com/TerracodeBA/vx/internal/version.Version=v0.1.0 ...".
Index ¶
Constants ¶
const Header = "X-Vx-Version"
Header is the request header in which the CLI sends its version.
const MinCLIVersion = "0.1.0"
MinCLIVersion is the oldest vx CLI this server works with. A server refuses requests from older release builds with an "update vx" error. Raise it when the server stops understanding what older CLIs send.
Variables ¶
var ( Version = "dev" Commit = "" Date = "" )
Set by the release build.
Functions ¶
func Compare ¶ added in v0.2.0
Compare compares two release versions like 0.3.1 or v0.3.1-rc.1 and returns -1, 0 or 1. ok is false when either is not a release version.
func IsDev ¶ added in v0.2.0
IsDev reports whether v is not a release version: "dev", empty, or anything that does not parse as one. Dev builds are never refused and never told to update.
func OlderThanServer ¶ added in v0.5.0
OlderThanServer says, in one line, that the CLI version cli is older than the release the server runs, and how to fix it:
vx v0.3.0 is older than the server (v0.4.0): vx self-update
It is empty when cli is a dev build, the server's version is not a release, or cli is not older than the server's release.
Types ¶
This section is empty.