Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Availability ¶ added in v1.31.0
Availability reports which of Self-update and Restart qui offers.
func Decide ¶ added in v1.31.0
func Decide(in Inputs) Availability
type Inputs ¶ added in v1.31.0
type Inputs struct {
AppContainer bool
DisableSelfUpdate bool
ReleaseVersion bool
DirWritable bool
// BinaryPath is the resolved binary that a Restart execs. Decide ignores it.
BinaryPath string
}
Inputs are the facts that decide Availability. qui measures them once at startup.
type Restarter ¶ added in v1.31.0
type Restarter struct {
// Mutex is the one lock over every system action, taken with TryLock by the
// API and the Tray. A successful action ends in a Restart, so only a failed
// action unlocks it.
sync.Mutex
// contains filtered or unexported fields
}
Restarter carries a Restart request from the API to the serve loop. See docs/adr/0011-restart-replaces-the-process-in-place.md.
func NewRestarter ¶ added in v1.31.0
NewRestarter takes the binary path that Measure resolved at startup, before a Self-update can replace the file.
func (*Restarter) Request ¶ added in v1.31.0
Request checks the binary, then asks the serve loop to restart. On an error qui keeps running: on Unix without a supervisor, a failed exec leaves qui down.
type Result ¶ added in v1.31.0
type Result struct {
// Version has no "v" prefix, the same format as GET /api/version.
Version string `json:"version"`
RollbackCommand string `json:"rollbackCommand"`
BackupError string `json:"backupError"`
}
Result describes a successful Self-update.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service periodically checks api.autobrr.com for new qui releases and caches the latest result.
func NewService ¶
NewService creates a new update Service instance.
func (*Service) CheckUpdateAvailable ¶
CheckUpdateAvailable performs an update check and returns the new release if one is available.
func (*Service) CheckUpdates ¶
CheckUpdates triggers a refresh of the latest release information if updates are enabled.
func (*Service) GetLatestRelease ¶
GetLatestRelease returns the last known release if a newer version has been found.
func (*Service) SetEnabled ¶
SetEnabled toggles whether periodic update checks should run.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}