upgrade

package
v0.10.21 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2015 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	MajorOlder Relation = -2 // Older by a major version (x in x.y.z or 0.x.y).
	Older               = -1 // Older by a minor version (y or z in x.y.z, or y in 0.x.y)
	Equal               = 0  // Versions are semantically equal
	Newer               = 1  // Newer by a minor version (y or z in x.y.z, or y in 0.x.y)
	MajorNewer          = 2  // Newer by a major version (x in x.y.z or 0.x.y).
)

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 To added in v0.10.12

func To(rel Release) error

A wrapper around actual implementations

func ToURL added in v0.10.14

func ToURL(url string) error

A wrapper around actual implementations

Types

type Asset

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

type Relation added in v0.10.15

type Relation int

func CompareVersions

func CompareVersions(a, b string) Relation

Returns a relation describing how a compares to b.

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