Documentation
¶
Index ¶
- Constants
- func CheckForUpdate(currentVersion string) string
- func ClearAvailableUpdate()
- func DownloadAndInstall(version string) error
- func DownloadAndInstallDeb(version string) error
- func DownloadAndInstallRpm(version string) error
- func DownloadDeb(version string) (string, error)
- func DownloadRpm(version string) (string, error)
- func GetCachedAvailableUpdate() string
- func IsPackageManaged() bool
- func SaveAvailableUpdate(version string)
- func SaveLastCheckTime()
- func ShouldCheckForUpdate() bool
- type GitHubRelease
Constants ¶
const ( RepoOwner = "izll" RepoName = "agent-session-manager" BinaryName = "asmgr" CheckTimeout = 5 * time.Second CheckInterval = 24 * time.Hour // Check for updates once per day LastCheckFile = "last_update_check" AvailableUpdateFile = "available_update" )
Variables ¶
This section is empty.
Functions ¶
func CheckForUpdate ¶
CheckForUpdate checks if a newer version is available Returns the new version string if available, empty string if up to date
func ClearAvailableUpdate ¶ added in v0.7.5
func ClearAvailableUpdate()
ClearAvailableUpdate removes the cached update (call after successful update)
func DownloadAndInstall ¶
DownloadAndInstall downloads and installs the specified version
func DownloadAndInstallDeb ¶ added in v0.3.7
DownloadAndInstallDeb downloads the .deb package and installs it via dpkg This is called from background goroutine
func DownloadAndInstallRpm ¶ added in v0.3.7
DownloadAndInstallRpm downloads the .rpm package and installs it via rpm
func DownloadDeb ¶ added in v0.3.7
DownloadDeb downloads the .deb package to /tmp and returns the path
func DownloadRpm ¶ added in v0.3.7
DownloadRpm downloads the .rpm package to /tmp and returns the path
func GetCachedAvailableUpdate ¶ added in v0.7.5
func GetCachedAvailableUpdate() string
GetCachedAvailableUpdate returns the cached available update version (if any)
func IsPackageManaged ¶ added in v0.3.7
func IsPackageManaged() bool
IsPackageManaged checks if the binary was installed via a package manager
func SaveAvailableUpdate ¶ added in v0.7.5
func SaveAvailableUpdate(version string)
SaveAvailableUpdate caches the available update version
func SaveLastCheckTime ¶ added in v0.5.2
func SaveLastCheckTime()
SaveLastCheckTime saves the current time as the last update check time
func ShouldCheckForUpdate ¶ added in v0.5.2
func ShouldCheckForUpdate() bool
ShouldCheckForUpdate returns true if enough time has passed since the last check