update

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package update provides automatic update functionality for GitHubby

Index

Constants

View Source
const (
	// RepoOwner is the GitHub repository owner
	RepoOwner = "Didstopia"
	// RepoName is the GitHub repository name
	RepoName = "githubby"
)

Variables

This section is empty.

Functions

func FormatUpdateNotification

func FormatUpdateNotification(result *Result) string

FormatUpdateNotification returns a formatted string for the update notification

func GetPlatform

func GetPlatform() string

GetPlatform returns the current platform string (os/arch)

Types

type Result

type Result struct {
	// CurrentVersion is the currently running version
	CurrentVersion string
	// LatestVersion is the latest available version
	LatestVersion string
	// Available indicates if an update is available
	Available bool
	// ReleaseURL is the URL to the release page
	ReleaseURL string
	// ReleaseNotes contains the release notes (if available)
	ReleaseNotes string
}

Result contains information about an available update

func CheckForUpdate

func CheckForUpdate(ctx context.Context, currentVersion string) (*Result, error)

CheckForUpdate is a convenience function that creates an Updater and checks for updates

func Update

func Update(ctx context.Context, currentVersion string) (*Result, error)

Update is a convenience function that creates an Updater and performs an update

type Updater

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

Updater handles checking and performing updates

func NewUpdater

func NewUpdater(currentVersion string) *Updater

NewUpdater creates a new Updater instance

func (*Updater) CheckForUpdate

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

CheckForUpdate checks if a new version is available

func (*Updater) Update

func (u *Updater) Update(ctx context.Context) (*Result, 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