updatecheck

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func GetLatestAppcastRelease() (string, error)

GetLatestAppcastRelease downloads and parses the appcast.xml file to get the latest version

func GetLatestRelease

func GetLatestRelease() (string, error)

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 AppcastItemEnclosure struct {
	URL     string `xml:"url,attr"`
	Version string `xml:"http://www.andymatuschak.org/xml-namespaces/sparkle version,attr"`
}

type GitHubRelease

type GitHubRelease struct {
	TagName string `json:"tag_name"`
}

GitHubRelease represents the GitHub release API response

Jump to

Keyboard shortcuts

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