Documentation
¶
Overview ¶
Package version is the single source of truth for the build version and a best-effort "is a newer release out?" check against the GitHub tags.
Index ¶
Constants ¶
const Repo = "Veyal/interceptor"
Repo is the GitHub owner/name used for the update check.
const Version = "0.27.0"
Version is the baked-in fallback version for dev builds. Release binaries report the real version from the module build info (the git tag) instead, so this constant deliberately tracks the last *published* release — bumping it ahead of the tag would break the update-check test, which verifies the named release actually exists on GitHub.
Variables ¶
var ErrRestartRequired = errors.New("restart required to finish update")
ErrRestartRequired means the new binary is staged and the process should exit so a Windows updater script can replace the running executable.
Functions ¶
func CheckLatest ¶
CheckLatest queries GitHub for the latest release tag and reports whether it is newer than the running version. Best-effort: any error (offline, rate limit, etc.) returns ("", false, err) for the caller to ignore quietly.
func String ¶
func String() string
String returns the running version: the module version when installed via `go install …@vX.Y.Z` (authoritative), otherwise the baked-in constant. It deliberately ignores "(devel)" and pseudo-versions (vX.Y.Z-0.<ts>-<hash>) from between-tags local builds, which would otherwise look ugly in the UI/logs.
func Update ¶ added in v0.8.0
func Update(ctx context.Context, opts UpdateOptions) error
Update checks GitHub for a newer (or requested) release and installs it. It prefers a prebuilt binary asset for the current OS/arch; if none is attached to the release it falls back to `go install` when the Go toolchain is available.