updater

package
v0.0.0-...-c997948 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AllowPrereleases defines whether pre-releases may be included
	AllowPrereleases = false
)

Functions

func GithubLatest

func GithubLatest(repo, name string) (string, string, string, error)

GithubLatest fetches the latest release info & returns release tag, filename & download url

func GithubUpdate

func GithubUpdate(repo, appName, currentVersion string) (string, error)

GithubUpdate the running binary with the latest release binary from Github

func GreaterThan

func GreaterThan(toVer, fromVer string) bool

GreaterThan compares the current version to a different version returning < 1 not upgradeable

func TarGZExtract

func TarGZExtract(inputFilePath, outputFilePath string) (err error)

TarGZExtract extracts a archive from the file inputFilePath. It tries to create the directory structure outputFilePath contains if it doesn't exist. It returns potential errors to be checked or nil if everything works.

func Unzip

func Unzip(src string, dest string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (src) to an output directory (dest).

Types

type Release

type Release struct {
	Name string
	Tag  string
	URL  string
	Size int64
}

Release struct contains the file data for downloadable release

type Releases

type Releases []struct {
	Name       string `json:"name"`       // release name
	Tag        string `json:"tag_name"`   // release tag
	Prerelease bool   `json:"prerelease"` // Github pre-release
	Assets     []struct {
		BrowserDownloadURL string `json:"browser_download_url"`
		ID                 int64  `json:"id"`
		Name               string `json:"name"`
		Size               int64  `json:"size"`
	} `json:"assets"`
}

Releases struct for Github releases json

Jump to

Keyboard shortcuts

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