Documentation
¶
Overview ¶
Package updates contains logic for checking if an update is available for ToolHive.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldSkipUpdateChecks ¶ added in v0.2.2
func ShouldSkipUpdateChecks() bool
ShouldSkipUpdateChecks returns true if update checks should be skipped. This includes CI environments and other scenarios where automated update checking is undesirable.
func TryGetAnonymousID ¶ added in v0.6.3
TryGetAnonymousID returns the instance ID from the updates file if it exists. This is a read-only operation - it never generates a new ID. Returns empty string if the file doesn't exist or doesn't contain an instance ID. Use this for optional features like metrics that shouldn't trigger ID generation. TODO this should probably be extracted into its own package to handle instance ID generation.
Types ¶
type UpdateChecker ¶
type UpdateChecker interface {
// CheckLatestVersion checks if a new version of ToolHive is available
// and prints the result to the console.
CheckLatestVersion() error
}
UpdateChecker is an interface for checking if a new version of ToolHive is available.
func NewUpdateChecker ¶
func NewUpdateChecker(versionClient VersionClient) (UpdateChecker, error)
NewUpdateChecker creates a new instance of UpdateChecker.
type VersionClient ¶
type VersionClient interface {
GetLatestVersion(instanceID string, currentVersion string) (string, error)
GetComponent() string
}
VersionClient is an interface for calling the update service API.
func NewVersionClient ¶
func NewVersionClient() VersionClient
NewVersionClient creates a new instance of VersionClient.
func NewVersionClientForComponent ¶ added in v0.1.8
func NewVersionClientForComponent(component, version string, uiReleaseBuild bool) VersionClient
NewVersionClientForComponent creates a new instance of VersionClient for a specific component.