updateprefs

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 2 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 updateprefs declares the update setting's key and its choices: what the app does when a new version is out (update.mode). The settings package writes it, and the update package reads it. It is a leaf that imports nothing of the app's, so settings never depends on the update package, nor the update package on settings.

The update package keeps its own state under the other update.* keys, which it alone writes: none of them is a setting.

Index

Constants

View Source
const DefaultMode = ModeDownload

DefaultMode is the choice of a fresh database.

View Source
const KeyMode = "update.mode"

KeyMode is the preference key holding what the app does when a new version is out: one of the Mode choices, DefaultMode when unset.

Variables

View Source
var ErrUnknownMode = errors.New("unknown update mode")

ErrUnknownMode is returned for a mode that is not one of the choices.

Functions

This section is empty.

Types

type Mode

type Mode string

Mode is what the app does when a new version is out.

const (
	// ModeDownload checks on its own, downloads a new version and checks it, then tells
	// the user it is ready: "Download it and tell me".
	ModeDownload Mode = "download"

	// ModeNotify checks on its own and tells the user a new version is out; Update then
	// downloads and restarts as one click: "Just tell me".
	ModeNotify Mode = "notify"

	// ModeOff makes no timed checks: "Don't check". Check for Updates still works.
	ModeOff Mode = "off"
)

The choices, in the order Settings offers them.

func Decode

func Decode(stored string) Mode

Decode reads a stored mode: as stored when it is one of the choices, else DefaultMode.

func Modes

func Modes() []Mode

Modes returns every choice, in the order Settings offers them.

func (Mode) Checks

func (m Mode) Checks() bool

Checks reports whether m makes timed checks: every choice but ModeOff.

func (Mode) Valid

func (m Mode) Valid() bool

Valid reports whether m is one of the choices.

Jump to

Keyboard shortcuts

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