version

package
v0.101.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var (
	ErrReleaseNotFound = errors.New("release not found")
)
View Source
var RunAt time.Time
View Source
var RunAtEpoch string

Functions

func CheckForUpdatesInBackground added in v0.96.0

func CheckForUpdatesInBackground(currentVersion string, homebrewFormula string)

CheckForUpdatesInBackground starts a goroutine to check for updates and save the results to the cache file. It never blocks and silently handles all errors.

func ClearUpdateCache added in v0.96.0

func ClearUpdateCache()

ClearUpdateCache removes the update cache file Silently fails - no errors are returned

func PerformUpgrade added in v0.42.0

func PerformUpgrade() error

func Print added in v0.42.0

func Print()

func PrintIfUpgradeAvailable added in v0.42.0

func PrintIfUpgradeAvailable()

PrintToStdErrIfUpgradeAvailable prints the update info to stderr if available

func Refresh

func Refresh()

func SaveUpdateCache added in v0.96.0

func SaveUpdateCache(currentVersion string, updateInfo *UpdateInfo)

SaveUpdateCache saves the update information to the cache file Silently fails - no errors are returned

func SetDebugMode added in v0.96.0

func SetDebugMode(debug bool)

SetDebugMode enables or disables debug mode

func SetUpdateInfo added in v0.96.0

func SetUpdateInfo(updateInfo *UpdateInfo)

SetUpdateInfo updates the current build's update info

func VerifyCanUpgrade added in v0.42.0

func VerifyCanUpgrade() error

func Version

func Version() string

Types

type Build

type Build struct {
	Version    string      `json:"version,omitempty"`
	UpdateInfo *UpdateInfo `json:"updateInfo,omitempty"`
}

Build holds details about this build of the replicated cli binary

func GetBuild

func GetBuild() Build

type ClientVersions added in v0.83.2

type ClientVersions struct {
	ReplicatedCLI string `json:"replicated_cli"`
	ReplicatedSDK string `json:"replicated_sdk"`
	KOTS          string `json:"kots"`
}

type Option added in v0.83.2

type Option func(*UpdateChecker) error

type PingResponse added in v0.83.2

type PingResponse struct {
	ClientIP       string         `json:"client_ip"`
	ClientVersions ClientVersions `json:"client_versions"`
}

type UpdateCache added in v0.96.0

type UpdateCache struct {
	Version       string     `json:"cachedVersion"`
	UpdateInfo    UpdateInfo `json:"updateCheckerInfo"`
	LastCheckedAt time.Time  `json:"lastCheckedAt"`
}

UpdateCache represents the cached update information

func LoadUpdateCache added in v0.96.0

func LoadUpdateCache() (*UpdateCache, error)

LoadUpdateCache loads the update information from the cache file Returns nil without error if the cache doesn't exist or is invalid

type UpdateChecker added in v0.83.2

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

func NewUpdateChecker added in v0.83.2

func NewUpdateChecker(version string, homebrewFormula string) (*UpdateChecker, error)

func (UpdateChecker) CanSupportUpgrade added in v0.83.2

func (s UpdateChecker) CanSupportUpgrade() (bool, error)

func (UpdateChecker) ExternalUpgradeCommand added in v0.83.2

func (s UpdateChecker) ExternalUpgradeCommand() string

func (UpdateChecker) GetUpdateInfo added in v0.83.2

func (s UpdateChecker) GetUpdateInfo() (*UpdateInfo, error)

GetUpdateInfo will return the latest version

func (UpdateChecker) Upgrade added in v0.83.2

func (s UpdateChecker) Upgrade() error

type UpdateInfo added in v0.83.2

type UpdateInfo struct {
	LatestVersion   string     `json:"latestVersion"`
	LatestReleaseAt *time.Time `json:"latestReleaseAt"`

	CheckedAt *time.Time `json:"checkedAt"`

	CanUpgradeInPlace      bool   `json:"canUpgradeInPlace"`
	ExternalUpgradeCommand string `json:"externalUpgradeCommand"`
}

func UpdateInfoFromVersions added in v0.83.2

func UpdateInfoFromVersions(currentVersion string, latestVersion *VersionInfo) (*UpdateInfo, error)

type VersionInfo added in v0.83.2

type VersionInfo struct {
	Version string `json:"version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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