update

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// GitHubReleasesURL is the API endpoint for releases
	GitHubReleasesURL = "https://api.github.com/repos/nerveband/beeper-api-cli/releases/latest"
	// CacheFileName is the name of the update cache file
	CacheFileName = "update-cache.json"
	// CacheDuration is how long to cache update checks
	CacheDuration = 24 * time.Hour
)

Variables

This section is empty.

Functions

func CheckAsync

func CheckAsync(currentVersion string) <-chan *UpdateInfo

CheckAsync performs an update check in a goroutine and returns results via channel

func FormatUpdateNotice

func FormatUpdateNotice(info *UpdateInfo) string

FormatUpdateNotice formats an update notification message

Types

type GitHubRelease

type GitHubRelease struct {
	TagName     string    `json:"tag_name"`
	Name        string    `json:"name"`
	PublishedAt time.Time `json:"published_at"`
	HTMLURL     string    `json:"html_url"`
}

GitHubRelease represents a GitHub release response

type UpdateCache

type UpdateCache struct {
	LastCheck      time.Time `json:"last_check"`
	LatestVersion  string    `json:"latest_version"`
	ReleaseURL     string    `json:"release_url"`
	CurrentVersion string    `json:"current_version"`
}

UpdateCache stores cached update information

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion  string
	LatestVersion   string
	ReleaseURL      string
	UpdateAvailable bool
}

UpdateInfo contains information about an available update

func Check

func Check(currentVersion string) (*UpdateInfo, error)

Check checks for updates and returns info about available updates Uses cached data if available and not expired

Jump to

Keyboard shortcuts

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