update

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 NewUpdater

func NewUpdater() (*Updater, error)

NewUpdater creates a new updater instance

func (*Updater) CheckForUpdates

func (u *Updater) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)

CheckForUpdates checks if there's a newer version available

func (*Updater) GetLatestVersion

func (u *Updater) GetLatestVersion(ctx context.Context) (string, error)

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

Jump to

Keyboard shortcuts

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