Documentation
¶
Index ¶
Constants ¶
const APIVersion = 1
APIVersion is the daemon's HTTP API contract version. Bump it on any backwards-incompatible change to request/response shapes or routes (additive optional fields don't count). The client compares its compiled-in value to the daemon's reported value to detect skew instead of silently degrading.
Variables ¶
var Version = "dev"
Version is the semver build version, set at build time via -ldflags. "dev" (or a git-describe string) for un-tagged local builds.
Functions ¶
func Compare ¶
Compare returns -1, 0, or +1 comparing two semver strings (a leading 'v' and any -prerelease/+build suffix are ignored). Non-semver inputs ("dev", hashes) sort below any real release and compare equal to each other — callers should treat an unknown-vs-unknown 0 as "can't tell".
func IsExactRelease ¶ added in v0.8.61
IsExactRelease reports whether v is a clean release tag — vX.Y.Z with no -prerelease/+build suffix — and so names a real published release. Use this (not IsRelease) whenever the version has to resolve to a downloadable asset or a git tag: "v0.8.60-3-gabc1234" is three commits PAST v0.8.60 and no release by that name exists, so fetching it 404s.
func IsRelease ¶
IsRelease reports whether v carries a usable semver core (vX.Y.Z), as opposed to "dev". Deliberately LENIENT: parseSemver drops any -prerelease/+build suffix, so a git-describe string like "v0.8.60-3-gabc1234" also passes. That's what comparison callers want — such a build really is "at least v0.8.60" for skew checks. Callers that need a version to name a PUBLISHED artifact (a release asset to download) must use IsExactRelease instead.
Types ¶
This section is empty.