upgrade

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package upgrade performs automatic upgrade of the running binary.

Index

Constants

This section is empty.

Variables

View Source
var ErrHashMismatch = errors.New("hash mismatch")

The binary's SHA1 hash was incorrect after downloading.

Functions

func UpgradeTo

func UpgradeTo(build Build) error

UpgradeTo upgrades the currently exeuting binary to the specified Build and returns an error or nil. The file is downloaded to <destination>.part and atomically renamed to the destination after the hash check. The destination is taken as the path of the currently executing binary, while following any symbolic links to it's destination.

Types

type Build

type Build struct {
	URL        string
	Hash       string
	BuildStamp int
	Version    string
}

Build is a versioned build of a binary.

func Newest

func Newest(binary string, url string) (Build, error)

Newest checks for the newest build available for a given binary at a given base URL and returns a Build or an error.

Jump to

Keyboard shortcuts

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