releasecheck

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterval = 24 * time.Hour
)

Variables

View Source
var ErrSkipped = errors.New("release check skipped")
View Source
var GitHubAPI = "https://api.github.com"

Functions

func Notice

func Notice(appName, installHint string, result Result) string

func ShouldNotify

func ShouldNotify(opts NotifyOptions) (bool, string)

func StatusText

func StatusText(appName, installHint string, result Result) string

func StderrIsTerminal

func StderrIsTerminal() bool

Types

type NotifyOptions

type NotifyOptions struct {
	Options
	Stderr      io.Writer
	InstallHint string
	Args        []string
	JSONOutput  bool
	IsTerminal  bool
	Getenv      func(string) string
}

type Options

type Options struct {
	AppName        string
	Owner          string
	Repo           string
	CurrentVersion string
	CacheDir       string
	Interval       time.Duration
	Force          bool
	Client         *http.Client
	Now            func() time.Time
}

type Result

type Result struct {
	CheckedAt       time.Time `json:"checked_at"`
	CurrentVersion  string    `json:"current_version"`
	LatestVersion   string    `json:"latest_version,omitempty"`
	LatestURL       string    `json:"latest_url,omitempty"`
	UpdateAvailable bool      `json:"update_available"`
	FromCache       bool      `json:"from_cache"`
	Skipped         bool      `json:"skipped,omitempty"`
	Reason          string    `json:"reason,omitempty"`
}

func Check

func Check(ctx context.Context, opts Options) (Result, error)

func Notify

func Notify(ctx context.Context, opts NotifyOptions) (Result, error)

Jump to

Keyboard shortcuts

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