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
Click to show internal directories.
Click to hide internal directories.