selfupdate

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHasNewVersion

func IsHasNewVersion(err error) bool

IsHasNewVersion asserts hasNewVersionError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsVersionNotFound

func IsVersionNotFound(err error) bool

IsVersionNotFound asserts versionNotFoundError.

Types

type Config

type Config struct {
	// GithubToken will be used when fetching versions
	// from private GitHub repositories.
	GithubToken string
	// CurrentVersion is the currently installed version
	// of the application.
	CurrentVersion string
	// RepositoryURL is the URL to the GitHub repository.
	RepositoryURL string
	// CacheDir is the path to the directory where the
	// cache should be stored.
	CacheDir string
}

type Updater

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

func New

func New(c Config) (*Updater, error)

func (*Updater) GetLatest

func (u *Updater) GetLatest() (version string, err error)

GetLatest returns the latest version available in the source repository, and if we can upgrade to that version or not (it can be equal to the current version).

func (*Updater) InstallLatest

func (u *Updater) InstallLatest() error

InstallLatest installs the newest version that can be installed.

Jump to

Keyboard shortcuts

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