Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownArchiveType = errors.New("unknown archive type") ErrNoMatchingArchitectures = errors.New("no matching architectures") ErrNoAssets = errors.New("no assets") ErrChecksumMismatch = errors.New("checksum mismatch") ErrUnsupportedChecksumFormat = errors.New("unsupported checksum format") )
var ErrReleaseNotFound = errors.New("release not found")
Functions ¶
This section is empty.
Types ¶
type ExternalPackageManager ¶
func NewHomebrewExternalPackageManager ¶
func NewHomebrewExternalPackageManager(formula string) ExternalPackageManager
type GitHubUpdateChecker ¶
type GitHubUpdateChecker struct {
// contains filtered or unexported fields
}
func (GitHubUpdateChecker) DownloadVersion ¶
func (c GitHubUpdateChecker) DownloadVersion(version string, requireChecksumMatch bool) (string, error)
DownloadVersion will download and extract the specific version, returning a path to the extracted file in the archive it's the responsibility of the caller to clean up the extracted file
func (GitHubUpdateChecker) GetLatestVersion ¶
func (c GitHubUpdateChecker) GetLatestVersion() (*VersionInfo, error)
GetLatestVersion will return the latest version from the git repository
type HomebrewExternalPackageManager ¶
type HomebrewExternalPackageManager struct {
// contains filtered or unexported fields
}
func (HomebrewExternalPackageManager) IsInstalled ¶
func (m HomebrewExternalPackageManager) IsInstalled() (bool, error)
IsInstalled will return true if the formula is installed using homebrew
func (HomebrewExternalPackageManager) UpgradeCommand ¶
func (m HomebrewExternalPackageManager) UpgradeCommand() string
type Option ¶
Option is a functional option for configuring the client
func UsingGitHubUpdateChecker ¶
Using GitHubUpdateChecker will cause the repo passed in to be the source of truth when checking for new updates
func UsingHomebrewFormula ¶
UsingHomebrewFormula will cause the formula passed in to be used when checking if this CLI was installed using homebrew
func UsingLogger ¶
UsingLogger can be set if you want to get log output from this sdk By default no log output is emitted.
type SDK ¶
type SDK struct {
// contains filtered or unexported fields
}
func (SDK) ExternalUpgradeCommand ¶
func (SDK) GetUpdateInfo ¶
func (s SDK) GetUpdateInfo() (*UpdateInfo, error)
GetUpdateInfo will return the latest version
type UpdateChecker ¶
type UpdateChecker interface {
GetLatestVersion() (*VersionInfo, error)
DownloadVersion(version string, requireChecksumMatch bool) (string, error)
}
func NewGitHubUpdateChecker ¶
func NewGitHubUpdateChecker(fqRepo string) UpdateChecker