upgrade

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2015 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToURL

func ToURL(url string, key []byte) error

Types

type Asset

type Asset struct {
	// The asset name or description.
	Name string

	// The download URL.
	URL string
}

An Asset is an archive file for a given OS and architecture.

func MatchingAssets

func MatchingAssets(exp *regexp.Regexp, rel Release) []Asset

MatchingAssets returns the list of assets that have names matching the given expression. I.e., to get a list of assets suitable for Darwin/AMD64 where the convention is for assets to contain {{runtime.GOOS}}-{{runtime.GOARCH}} in the name:

assets := MatchingAssets(regex.MustCompile(`darwin-amd64`), myRelease)

type Release

type Release struct {
	// The Version should be in semver format, i.e. "0.1.2" or "v2.3.4".
	Version string

	// Assets are the actual files that make up the release, being one archive
	// file per OS and architecture.
	Assets []Asset
}

A Release represents a given software release.

func GithubReleases

func GithubReleases(project string, currentVersion string, allowMajorUpgrade bool, allowPrerelease bool) ([]Release, error)

GithubRelease returns a list of releases for the project that are newer than currentVersion. If allowMajorUpgrade is false, releases that are majorly newer than current are filtered out. If allowPrerelease is false, prerelease releases are filtered out. If an error occurs, the list of releases is empty and an error is set. An empty list of releases and a nil error means that no error ocurred, but there is no newer release available that meets the criteria.

rels, err := GithubReleases("calmh/someproject", "v1.2.3", true, false)

Directories

Path Synopsis
cmd
Package signature provides simple methods to create and verify signatures in PEM format.
Package signature provides simple methods to create and verify signatures in PEM format.

Jump to

Keyboard shortcuts

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