update

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 11 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 checks GitHub for newer maitake releases and their changelogs.

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
}

func NewChecker

func NewChecker(client *http.Client, current string, settings func() Settings) *Checker

func (*Checker) Check

func (c *Checker) Check(ctx context.Context) Snapshot

Check fetches releases now and returns the result.

func (*Checker) Run

func (c *Checker) Run(ctx context.Context)

func (*Checker) Snapshot

func (c *Checker) Snapshot() Snapshot

func (*Checker) Wake

func (c *Checker) Wake()

Wake makes the loop re-read its settings, e.g. after checks were switched back on.

type Release

type Release struct {
	Version     string    `json:"version"`
	URL         string    `json:"url"`
	PublishedAt time.Time `json:"publishedAt"`
	Sections    []Section `json:"sections"`
}

type Section

type Section struct {
	Title string   `json:"title"`
	Items []string `json:"items"`
}

Section is one heading of a release's changelog, e.g. "Features" with its entries.

func ParseNotes

func ParseNotes(body string) []Section

ParseNotes turns a release changelog body into plain-text sections, so the dashboard never renders markup from the release.

type Settings

type Settings struct {
	Enabled       bool `json:"enabled"`
	IntervalHours int  `json:"intervalHours"`
}

func DefaultSettings

func DefaultSettings() Settings

func (*Settings) Normalize

func (s *Settings) Normalize()

type Snapshot

type Snapshot struct {
	Current string   `json:"current"`
	Latest  *Release `json:"latest"`
	// Newer lists releases after the running version, newest first. Empty for dev builds.
	Newer     []Release  `json:"newer"`
	CheckedAt *time.Time `json:"checkedAt"`
	Error     string     `json:"error,omitempty"`
}

func (Snapshot) UpdateAvailable

func (s Snapshot) UpdateAvailable() bool

Jump to

Keyboard shortcuts

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