Documentation
¶
Overview ¶
Package version exposes build metadata injected via -ldflags -X at build time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" BuildTime = "unknown" )
These are overridden at build time:
go build -ldflags "-X github.com/Benny93/kafui/pkg/version.Version=v1.2.3 ..."
Functions ¶
func IsOutdated ¶
IsOutdated reports whether the running Version is older than latestTag. Comparison is a lenient semver-ish compare after stripping a leading "v"; non-release builds ("dev", empty) are never considered outdated.
func ShortCommit ¶
func ShortCommit() string
ShortCommit returns the commit truncated to 7 characters.
Types ¶
type Info ¶
type Info struct {
Version string
Commit string
BuildTime string
GoVersion string
Platform string
Features []string
}
Info is the resolved build metadata plus the runtime environment.
type Release ¶
Release is the subset of the GitHub release payload we care about.
func CheckLatest ¶
CheckLatest queries the GitHub releases API for the newest published release. All failures are swallowed into a nil result + error; callers treat any error as "unknown, don't nag". Honors ctx and the given timeout.