updatecheck

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package updatecheck reports whether a newer diagrid-dev-dashboard release exists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReleaseVersion

func IsReleaseVersion(v string) bool

IsReleaseVersion reports whether v is a real released version (valid semver once a leading "v" is ensured). A source/dev build ("dev") is not.

Types

type Result

type Result struct {
	Current         string `json:"current"`
	Latest          string `json:"latest"`
	UpdateAvailable bool   `json:"updateAvailable"`
	ReleaseURL      string `json:"releaseUrl"`
}

Result is the update-availability payload shared by the CLI notice and the GET /api/update-check endpoint. When UpdateAvailable is true, Current and Latest are normalized with a leading "v" and ReleaseURL points at the release.

type Service

type Service interface {
	Check(ctx context.Context) Result
}

Service reports whether a newer release exists, caching the result.

func New

func New(client *http.Client, apiBase, repo, current string, ttl time.Duration) Service

New builds a caching update-check service. ttl is the positive cache lifetime; failed resolves are negatively cached for half the ttl, capped at 5m.

Jump to

Keyboard shortcuts

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