update

package
v1.0.2 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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