upgrade

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2014 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package upgrade downloads and compares releases, and upgrades the running binary.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVersionUpToDate    = errors.New("current version is up to date")
	ErrVersionUnknown     = errors.New("couldn't fetch release information")
	ErrUpgradeUnsupported = errors.New("upgrade unsupported")
	ErrUpgradeInProgress  = errors.New("upgrade already in progress")
)

Functions

func CompareVersions

func CompareVersions(a, b string) int

Returns 1 if a>b, -1 if a<b and 0 if they are equal

func UpgradeTo

func UpgradeTo(rel Release, archExtra string) error

A wrapper around actual implementations

Types

type Asset

type Asset struct {
	URL  string `json:"url"`
	Name string `json:"name"`
}

type Release

type Release struct {
	Tag        string  `json:"tag_name"`
	Prerelease bool    `json:"prerelease"`
	Assets     []Asset `json:"assets"`
}

func LatestRelease

func LatestRelease(prerelease bool) (Release, error)

Returns the latest release, including prereleases or not depending on the argument

Jump to

Keyboard shortcuts

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