upgrade

package
v0.11.17 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2015 License: MPL-2.0 Imports: 20 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

func ToURL added in v0.10.14

func ToURL(url string) error

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

CompareVersions 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 LatestGithubReleases added in v0.10.31

func LatestGithubReleases(version string) ([]Release, error)

LatestGithubReleases returns the latest releases, including prereleases or not depending on the argument

func LatestRelease

func LatestRelease(version string) (Release, error)

func SelectLatestRelease added in v0.10.31

func SelectLatestRelease(version string, rels []Release) (Release, error)

type SortByRelease added in v0.10.31

type SortByRelease []Release

func (SortByRelease) Len added in v0.10.31

func (s SortByRelease) Len() int

func (SortByRelease) Less added in v0.10.31

func (s SortByRelease) Less(i, j int) bool

func (SortByRelease) Swap added in v0.10.31

func (s SortByRelease) Swap(i, j int)

Jump to

Keyboard shortcuts

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