updater

package
v0.0.0-...-16efc32 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

Asset represents a release asset

type CheckResult

type CheckResult struct {
	CurrentVersion  string
	LatestVersion   string
	UpdateAvailable bool
	ReleaseURL      string
	PublishedAt     string
}

CheckResult contains the result of a version check

type ReleaseInfo

type ReleaseInfo struct {
	TagName     string  `json:"tag_name"`
	Name        string  `json:"name"`
	Draft       bool    `json:"draft"`
	Prerelease  bool    `json:"prerelease"`
	PublishedAt string  `json:"published_at"`
	Assets      []Asset `json:"assets"`
}

ReleaseInfo contains GitHub release metadata

type Updater

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

Updater handles version checking and binary updates

func NewUpdater

func NewUpdater(currentVersion string) *Updater

NewUpdater creates a new updater instance

func (*Updater) CheckForUpdate

func (u *Updater) CheckForUpdate(ctx context.Context) (*CheckResult, error)

CheckForUpdate fetches latest release info and compares versions

func (*Updater) Update

func (u *Updater) Update(ctx context.Context, progressFn func(downloaded, total int64)) error

Update downloads and installs the latest version

Jump to

Keyboard shortcuts

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