version

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package version reports which Bespoke release a process is running and whether a newer one has been published (ADR-0034). The running release comes from the build's module graph — an instance pins the platform in go.mod (ADR-0027), so nothing has to be stamped in at build time.

Index

Constants

View Source
const Dev = "dev"

Dev is reported when the build carries no release pin: a working tree, a `go run`, or a replace/go.work override.

View Source
const Module = "github.com/bketelsen/bespoke"

Module is the public platform module path (ADR-0027).

Variables

This section is empty.

Functions

func Platform

func Platform() string

Platform returns the pinned platform release ("v0.11.0"), or Dev.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker caches the newest published release. It is safe for concurrent use and never blocks a request: checks happen in the background and every failure is soft — an instance with no outbound network still renders its own version.

func NewChecker

func NewChecker() *Checker

NewChecker returns a Checker for the running platform release. Dev builds have no release to compare against, and BESPOKE_UPDATE_CHECK=off drops the outbound call entirely (the footer then shows the running version alone).

func (*Checker) Info

func (c *Checker) Info() Info

Info returns what the last successful check found, refreshing in the background when the cached answer has expired. It never blocks on the network, so the first dashboard render after a restart shows the running version and picks up the update notice on the next one.

type Info

type Info struct {
	// Current is the running release, or Dev.
	Current string
	// Latest is the newest published release; empty until a check succeeds
	// and whenever checking is off.
	Latest string
	// URL is Latest's release page, empty alongside Latest.
	URL string
	// Outdated reports that Latest is a newer release than Current.
	Outdated bool
}

Info is the version state a UI renders.

Jump to

Keyboard shortcuts

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