Documentation
¶
Index ¶
- Constants
- Variables
- func GetFromTrayApp() bool
- func GetLatestAppcastRelease() (string, error)
- func GetLatestRelease() (string, error)
- func GetTrayAppPid() int
- func GetUpdatedVersion() string
- func StartUpdateChecker(trayPid int)
- func TriggerTrayAppUpdateCheck() error
- type Appcast
- type AppcastChannel
- type AppcastItem
- type AppcastItemEnclosure
- type GitHubRelease
Constants ¶
View Source
const ( // GitHubReleasesURL is the URL to check for the latest release GitHubReleasesURL = "https://api.github.com/repos/outrigdev/outrig/releases/latest" // InitialDelay is the delay before the first update check InitialDelay = 10 * time.Second // CheckInterval is the interval between update checks CheckInterval = 5 * time.Minute // UpdateCheckPeriod is how often we actually perform the check UpdateCheckPeriod = 8 * time.Hour )
Variables ¶
View Source
var ( // Disabled is a flag to disable update checking Disabled atomic.Bool )
Functions ¶
func GetFromTrayApp ¶
func GetFromTrayApp() bool
GetFromTrayApp returns whether the server was started from the tray app
func GetLatestAppcastRelease ¶
GetLatestAppcastRelease downloads and parses the appcast.xml file to get the latest version
func GetLatestRelease ¶
GetLatestRelease gets the latest release from GitHub
func GetTrayAppPid ¶
func GetTrayAppPid() int
GetTrayAppPid returns the PID of the tray app that started the server (0 if not from tray)
func GetUpdatedVersion ¶
func GetUpdatedVersion() string
GetUpdatedVersion returns the newer version if one is available
func StartUpdateChecker ¶
func StartUpdateChecker(trayPid int)
StartUpdateChecker starts the update checker routine
func TriggerTrayAppUpdateCheck ¶
func TriggerTrayAppUpdateCheck() error
TriggerTrayAppUpdateCheck sends a SIGUSR1 signal to the tray app to trigger update check
Types ¶
type Appcast ¶
type Appcast struct {
XMLName xml.Name `xml:"rss"`
Channel AppcastChannel `xml:"channel"`
}
Appcast represents the appcast XML structure
type AppcastChannel ¶
type AppcastChannel struct {
Items []AppcastItem `xml:"item"`
}
type AppcastItem ¶
type AppcastItem struct {
Title string `xml:"title"`
Description string `xml:"description"`
PubDate string `xml:"pubDate"`
Enclosures []AppcastItemEnclosure `xml:"enclosure"`
}
type AppcastItemEnclosure ¶
type GitHubRelease ¶
type GitHubRelease struct {
TagName string `json:"tag_name"`
}
GitHubRelease represents the GitHub release API response
Click to show internal directories.
Click to hide internal directories.