Documentation
¶
Index ¶
- func FormatShortUpdateMessage(info *UpdateInfo) string
- func FormatUpdateMessage(info *UpdateInfo) string
- func GetUpdateCommand(method InstallMethod) string
- func GetUpdateInstructions(method InstallMethod, latestVersion string) string
- type CachedUpdateCheck
- type Checker
- type InstallMethod
- type UpdateChannel
- type UpdateInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatShortUpdateMessage ¶
func FormatShortUpdateMessage(info *UpdateInfo) string
FormatShortUpdateMessage formats a brief update notification
func FormatUpdateMessage ¶
func FormatUpdateMessage(info *UpdateInfo) string
FormatUpdateMessage formats a user-friendly update notification message
func GetUpdateCommand ¶
func GetUpdateCommand(method InstallMethod) string
GetUpdateCommand returns the appropriate update command for the installation method
func GetUpdateInstructions ¶
func GetUpdateInstructions(method InstallMethod, latestVersion string) string
GetUpdateInstructions returns detailed update instructions
Types ¶
type CachedUpdateCheck ¶
type CachedUpdateCheck struct {
UpdateInfo *UpdateInfo `json:"update_info"`
CheckedAt time.Time `json:"checked_at"`
CacheTTL time.Duration `json:"cache_ttl"`
}
CachedUpdateCheck stores cached update check results
func (*CachedUpdateCheck) IsExpired ¶
func (c *CachedUpdateCheck) IsExpired() bool
IsExpired checks if the cached update check has expired
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker handles version checking and update notifications
func (*Checker) CheckForUpdates ¶
func (c *Checker) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)
CheckForUpdates checks if a new version is available
func (*Checker) ClearCache ¶
ClearCache removes cached update check
type InstallMethod ¶
type InstallMethod string
InstallMethod represents how Prism was installed
const ( InstallMethodHomebrew InstallMethod = "homebrew" InstallMethodScoop InstallMethod = "scoop" InstallMethodBinary InstallMethod = "binary" InstallMethodSource InstallMethod = "source" InstallMethodUnknown InstallMethod = "unknown" )
func DetectInstallMethod ¶
func DetectInstallMethod() InstallMethod
DetectInstallMethod determines how Prism was installed
func (InstallMethod) String ¶
func (im InstallMethod) String() string
String returns the string representation of the install method
type UpdateChannel ¶
type UpdateChannel string
UpdateChannel represents release channel (stable/beta/dev)
const ( ChannelStable UpdateChannel = "stable" ChannelBeta UpdateChannel = "beta" ChannelDev UpdateChannel = "dev" )
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
IsUpdateAvailable bool `json:"is_update_available"`
ReleaseURL string `json:"release_url"`
ReleaseNotes string `json:"release_notes"`
PublishedAt time.Time `json:"published_at"`
InstallMethod InstallMethod `json:"install_method"`
UpdateCommand string `json:"update_command"`
LastChecked time.Time `json:"last_checked"`
}
UpdateInfo contains information about an available update