update

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Latest(ctx context.Context) (*Release, error)
}

Client is a client that can get the latest release.

var Default Client = &github{}

Default is the default Client.

type Info

type Info struct {
	Current string
	Latest  string
	URL     string
}

Info contains information about an available update.

func Check

func Check(ctx context.Context, current string, client Client) (Info, error)

Check checks if a new version is available.

func (Info) Available

func (i Info) Available() bool

Available returns true if there's an update available.

If both current and latest are stable versions, returns true if versions are different. If current is a pre-release and latest isn't, returns true. If latest is a pre-release and current isn't, returns false.

func (Info) IsDevelopment

func (i Info) IsDevelopment() bool

type Release

type Release struct {
	TagName string `json:"tag_name"`
	HTMLURL string `json:"html_url"`
}

Release represents a GitHub release.

Jump to

Keyboard shortcuts

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