updater

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func CheckForUpdate(currentVersion string) string

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

func DownloadAndInstall(version string) error

DownloadAndInstall downloads and installs the specified version

func DownloadAndInstallDeb added in v0.3.7

func DownloadAndInstallDeb(version string) error

DownloadAndInstallDeb downloads the .deb package and installs it via dpkg This is called from background goroutine

func DownloadAndInstallRpm added in v0.3.7

func DownloadAndInstallRpm(version string) error

DownloadAndInstallRpm downloads the .rpm package and installs it via rpm

func DownloadDeb added in v0.3.7

func DownloadDeb(version string) (string, error)

DownloadDeb downloads the .deb package to /tmp and returns the path

func DownloadRpm added in v0.3.7

func DownloadRpm(version string) (string, error)

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

Types

type GitHubRelease

type GitHubRelease struct {
	TagName     string    `json:"tag_name"`
	PublishedAt time.Time `json:"published_at"`
}

Jump to

Keyboard shortcuts

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