update

package
v3.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: MIT Imports: 25 Imported by: 1

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 DownloadFileName

func DownloadFileName(version semver.Version) string

func Update

func Update(currentVersion semver.Version, downloader LatestCheckerDownloader, restartAfter bool) error

Types

type Downloader

type Downloader interface {
	Download(version semver.Version) (rc io.ReadCloser, size int64, err error)
}

type FileSystemLatestCheckerDownloader

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

func NewFileSystemLatestCheckerDownloader

func NewFileSystemLatestCheckerDownloader(baseDir string) *FileSystemLatestCheckerDownloader

func (*FileSystemLatestCheckerDownloader) Download

func (*FileSystemLatestCheckerDownloader) LatestVersion

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

type GithubLatestCheckerDownloader

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

func NewGithubLatestCheckerDownloader

func NewGithubLatestCheckerDownloader(owner, repo string, debugRequests bool) *GithubLatestCheckerDownloader

func (*GithubLatestCheckerDownloader) Download

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
	Downloader
}

type Package

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

Jump to

Keyboard shortcuts

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