update

package
v0.4.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubOwner = "mehmetkoksal-w"
	GitHubRepo  = "mind-palace"
)
View Source
const NoticeTTL = 24 * time.Hour

NoticeTTL is the cooldown period before showing the update notice again.

Variables

This section is empty.

Functions

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns the directory used for caching update information.

func MarkNoticeShown

func MarkNoticeShown(cacheDir string)

MarkNoticeShown updates the cache to record that the update notice was shown.

func ShouldShowNotice

func ShouldShowNotice(cacheDir string) bool

ShouldShowNotice checks if the update notice should be shown based on cooldown. Returns true if the notice hasn't been shown in the last 24 hours.

func Update

func Update(currentVersion string, progressFn func(string)) error

Update updates the palace binary to the latest version.

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	Size               int64  `json:"size"`
	BrowserDownloadURL string `json:"browser_download_url"`
}

Asset represents a release asset.

type CheckResult

type CheckResult struct {
	CurrentVersion  string
	LatestVersion   string
	UpdateAvailable bool
	ReleaseURL      string
	DownloadURL     string
	ChecksumURL     string
}

CheckResult contains information about an update check.

func Check

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

Check compares the current version with the latest release on GitHub.

func CheckCached

func CheckCached(currentVersion, cacheDir string) (*CheckResult, error)

CheckCached performs an update check, using a local cache if it's still valid.

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Name    string  `json:"name"`
	Body    string  `json:"body"`
	HTMLURL string  `json:"html_url"`
	Assets  []Asset `json:"assets"`
}

Release represents a GitHub release.

Jump to

Keyboard shortcuts

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