updater

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package updater provides self-update functionality for dotgh using GitHub releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReleaseInfo

type ReleaseInfo struct {
	Version      string
	URL          string
	ReleaseNotes string
	PublishedAt  time.Time
}

ReleaseInfo contains information about a release.

type Updater

type Updater struct {
	Owner string
	Repo  string
}

Updater handles checking for updates and applying them.

func New

func New(owner, repo string) *Updater

New creates a new Updater instance.

func (*Updater) CheckForUpdate

func (u *Updater) CheckForUpdate(ctx context.Context, currentVersion string) (*ReleaseInfo, bool, error)

CheckForUpdate checks if a newer version is available. Returns the release info, whether an update is available, and any error.

func (*Updater) Update

func (u *Updater) Update(ctx context.Context, release *ReleaseInfo) error

Update downloads and applies the specified release.

Jump to

Keyboard shortcuts

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