update

package
v3.0.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUpdateCheck    = chkitErrors.Err("unable to check latest version")
	ErrUpdateDownload = chkitErrors.Err("unable to download latest version")
)
View Source
const (
	ErrUnpack                = chkitErrors.Err("unable to unpack update file")
	ErrExpectedFilesNotFound = chkitErrors.Err("unable to find expected files in archive")
)
View Source
const (
	ErrUpdateApply = chkitErrors.Err("update apply failed")
)
View Source
const (
	MaxFileSize = 50 * (1 << 20) // 50 megabytes
)

Variables

View Source
var PublicKeyB64 = "cHVibGljIGtleQo="

Functions

func AskForUpdate

func AskForUpdate(ctx *cli.Context, latestVersion semver.Version) (bool, error)

func DownloadFileName

func DownloadFileName(version semver.Version) string

func Update

func Update(ctx *cli.Context, downloader LatestCheckerDownloader, restartAfter bool) error

Types

type FileSystemLatestCheckerDownloader

type FileSystemLatestCheckerDownloader struct {
	// contains filtered or unexported fields
}

func NewFileSystemLatestCheckerDownloader

func NewFileSystemLatestCheckerDownloader(ctx *cli.Context, baseDir string) *FileSystemLatestCheckerDownloader

func (*FileSystemLatestCheckerDownloader) LatestDownload

func (fs *FileSystemLatestCheckerDownloader) LatestDownload() (io.ReadCloser, error)

func (*FileSystemLatestCheckerDownloader) LatestVersion

func (fs *FileSystemLatestCheckerDownloader) LatestVersion() (semver.Version, error)

type GithubLatestCheckerDownloader

type GithubLatestCheckerDownloader struct {
	// contains filtered or unexported fields
}

func NewGithubLatestCheckerDownloader

func NewGithubLatestCheckerDownloader(ctx *cli.Context, owner, repo string) *GithubLatestCheckerDownloader

func (*GithubLatestCheckerDownloader) LatestDownload

func (gh *GithubLatestCheckerDownloader) LatestDownload() (io.ReadCloser, error)

func (*GithubLatestCheckerDownloader) LatestVersion

func (gh *GithubLatestCheckerDownloader) LatestVersion() (semver.Version, error)

type LatestChecker

type LatestChecker interface {
	LatestVersion() (semver.Version, error)
}

type LatestCheckerDownloader

type LatestCheckerDownloader interface {
	LatestChecker
	LatestDownloader
}

type LatestDownloader

type LatestDownloader interface {
	LatestDownload() (io.ReadCloser, error)
}

type Package

type Package struct {
	Binary    io.Reader `filename:"chkit"`
	Hash      io.Reader `filename:"sha256.sum"`
	Signature io.Reader `filename:"ecdsa.sig"`
}

func (*Package) Close

func (u *Package) Close()

Jump to

Keyboard shortcuts

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