update

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker performs a single non-blocking update check at startup. The result is stored atomically — safe to read from any goroutine. Implements api.UpdateChecker via Result.

func New

func New(currentVersion, releaseURL string) *Checker

New creates a Checker. releaseURL must return JSON with a "tag_name" or "version" field.

func (*Checker) GetCurrent

func (c *Checker) GetCurrent() string

GetCurrent implements api.UpdateChecker.

func (*Checker) GetLatest

func (c *Checker) GetLatest() string

GetLatest implements api.UpdateChecker.

func (*Checker) IsAvailable

func (c *Checker) IsAvailable() bool

IsAvailable implements api.UpdateChecker.

func (*Checker) Start

func (c *Checker) Start()

Start launches a single background check with a 5-second timeout. Returns immediately — result becomes available asynchronously.

type Result

type Result struct {
	Current   string
	Latest    string
	Available bool
	CheckedAt time.Time
	Err       string
}

Result holds the outcome of a single update check. Implements api.UpdateChecker interface.

func (*Result) GetCurrent

func (r *Result) GetCurrent() string

func (*Result) GetLatest

func (r *Result) GetLatest() string

func (*Result) IsAvailable

func (r *Result) IsAvailable() bool

Jump to

Keyboard shortcuts

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