Documentation
¶
Index ¶
Constants ¶
const ( GitHubOwner = "flatrun" GitHubRepo = "agent" BinaryName = "flatrun-agent" )
Variables ¶
This section is empty.
Functions ¶
func RestartService ¶
func RestartService() error
Types ¶
type Availability ¶
type Availability struct {
CurrentVersion string `json:"current_version"`
Channel Channel `json:"channel"`
LatestVersion string `json:"latest_version"`
UpdateAvailable bool `json:"update_available"`
Releases []ReleaseInfo `json:"releases"`
}
Availability describes the update picture for a channel: the running version, the highest version the channel offers, whether that is an upgrade, and every installable release newest-first.
func ListAvailable ¶
func ListAvailable(channel Channel) (*Availability, error)
ListAvailable returns every release the channel can install, newest-first by semver, so a client can present the choices and their changelogs without reimplementing the channel and ordering rules.
type Channel ¶
type Channel string
Channel selects which releases an update considers. Stable ignores prereleases; Prerelease is the opt-in channel that also sees betas.
type ReleaseInfo ¶
type ReleaseInfo struct {
Version string `json:"version"`
Prerelease bool `json:"prerelease"`
PublishedAt string `json:"published_at"`
Changelog string `json:"changelog"`
}
ReleaseInfo is a release presented to a client: the version without its `v` prefix, whether it is a prerelease, when it was published, and its changelog.
type UpdateResult ¶
type UpdateResult struct {
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
UpdateAvailable bool `json:"update_available"`
Downloaded bool `json:"downloaded"`
Installed bool `json:"installed"`
Message string `json:"message"`
}
func CheckForUpdate ¶
func CheckForUpdate(channel Channel) (*UpdateResult, error)