Documentation
¶
Index ¶
- Constants
- type ProgressCallback
- type UpdateInfo
- type UpdateOptions
- type Updater
- func (u *Updater) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)
- func (u *Updater) GetLatestVersion(ctx context.Context) (string, error)
- func (u *Updater) UpdateToLatest(ctx context.Context, progressCallback ProgressCallback) error
- func (u *Updater) UpdateToVersion(ctx context.Context, targetVersion string, progressCallback ProgressCallback) error
- func (u *Updater) UpdateWithOptions(ctx context.Context, opts UpdateOptions) (*UpdateInfo, error)
Constants ¶
View Source
const ( // GitHub repository for releases GitHubOwner = "kcaldas" GitHubRepo = "genie" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressCallback ¶
type ProgressCallback func(current, total int64)
ProgressCallback is called during download to report progress
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string
LatestVersion string
ReleaseNotes string
DownloadURL string
UpdateNeeded bool
}
UpdateInfo contains information about an available update
type UpdateOptions ¶
type UpdateOptions struct {
Force bool // Force update even if no newer version
TargetVersion string // Update to specific version (empty for latest)
Timeout time.Duration // Timeout for update operation
ProgressCallback ProgressCallback // Callback for progress updates (currently unused)
}
UpdateOptions contains options for update operations
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater handles self-updating logic
func (*Updater) CheckForUpdates ¶
func (u *Updater) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)
CheckForUpdates checks if there's a newer version available
func (*Updater) GetLatestVersion ¶
GetLatestVersion gets the latest version without updating
func (*Updater) UpdateToLatest ¶
func (u *Updater) UpdateToLatest(ctx context.Context, progressCallback ProgressCallback) error
UpdateToLatest performs the actual update to the latest version
func (*Updater) UpdateToVersion ¶
func (u *Updater) UpdateToVersion(ctx context.Context, targetVersion string, progressCallback ProgressCallback) error
UpdateToVersion updates to a specific version
func (*Updater) UpdateWithOptions ¶
func (u *Updater) UpdateWithOptions(ctx context.Context, opts UpdateOptions) (*UpdateInfo, error)
UpdateWithOptions performs update with specified options
Click to show internal directories.
Click to hide internal directories.