upgrade

package
v0.10.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2014 License: MIT 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")
)

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

Upgrade to the given release, saving the previous binary with a ".old" extension.

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