autoupdate

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadBinary

func DownloadBinary(url string) (string, error)

DownloadBinary downloads a binary from a remote location and saves it to disk

func Init

func Init(version *LocalVersionInfo)

func InitFromString

func InitFromString(version string) error

func Upgrade

func Upgrade(binPath string) error

Types

type LocalVersionInfo

type LocalVersionInfo struct {
	Name                 string `json:"name"`
	Version              string `json:"version"`
	VersionCheckEndpoint string `json:"version_check_endpoint"`
}

LocalVersionInfo contains version info for the locally running binary

func CurrentVersion

func CurrentVersion() LocalVersionInfo

type OSPackage

type OSPackage struct {
	URL      string `json:"url"`
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	Checksum string `json:"checksum"`
}

OSPackage contains OS specific info for updating the correct version of the binary

func SelectVersionByOS

func SelectVersionByOS(packages []OSPackage) *OSPackage

type RemoteVersionInfo

type RemoteVersionInfo struct {
	Version    string      `json:"version"`
	OSPackages []OSPackage `json:"os_packages"`
}

RemoteVersionInfo contains version info for the published remote binary

func CheckVersion

func CheckVersion() (bool, *RemoteVersionInfo, error)

Jump to

Keyboard shortcuts

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