Documentation
¶
Index ¶
- Constants
- Variables
- func AskForUpdate(ctx *cli.Context, latestVersion semver.Version) (bool, error)
- func DownloadFileName(version semver.Version) string
- func Update(ctx *cli.Context, downloader LatestCheckerDownloader, restartAfter bool) error
- type FileSystemLatestCheckerDownloader
- type GithubLatestCheckerDownloader
- type LatestChecker
- type LatestCheckerDownloader
- type LatestDownloader
- type Package
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 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 LatestCheckerDownloader ¶
type LatestCheckerDownloader interface { LatestChecker LatestDownloader }
type LatestDownloader ¶
type LatestDownloader interface {
LatestDownload() (io.ReadCloser, error)
}
Click to show internal directories.
Click to hide internal directories.